Before executing these commands make sure you are in the public_html folder of the application you want to make changes to.

Delete a Folder or File

Delete/Remove a Folder: rm -rf FolderName

Delete/Remove a File: rm -r FileName

Backup a SQL Database Quickly

Export the Database:  mysqldump -uUSERNAME -p DATABASENAME > backup.sql

* USERNAME is the database username and DATABASENAM is the database name.  backup.sql can be renamed to whatever your backup to be called.  It will dump the backup into the public directory of your website.

Import a SQL Database from Command Line

mysql -u username -p database_name < database_file.sql

*Replace username with the database username, database_name with the name of your database and database_file.sql with the file name.

Compress A Folder

zip -r foldername

*filename is the name of the file you want to output the compression to and foldername is the name of the current directory you want to compress

Compress the current director you are in

This is handy if you want to backup the public_html folder in its entirety.  Just navigate to that folder then execute the following:

zip -r .

Be sure to include the space and then the period in the above.

ElasticPress WP CLI Commands

wp elasticpress index

This will index your ElasticPress database

Leave a Reply

Get in Touch

Please fill out the form below and we will get back to you ASAP

  • This field is for validation purposes and should be left unchanged.