1. Home »
  2. Tech

Guide To Useful SSH Commands

SSH

SSH is a very useful and secure connection to control your own web sever remotely. On Windows you can use PuTTY to connect to your server using SSH. Using SSH can be useful when deleting or moving large number of files at once as this process can take hours when you use FTP client.

Open Directory Using SSH

cd downloads/

Renaming Files Using SSH

mv original_file new_name

Move Folder And Content Using SSH

mv wordpress/* ./

This will move all the files in the directory named wordpress to the current working directory.

Copy Files Using SSH

cp original_file new_file

Where original_file is the original file name and new_file is your copied file name.

Delete Folder And Contents Using SSH

rm -rf foldername/

Database Backup Using SSH

First go to the directory you want your backup to be placed in by typing “cd” followed by the directory path.

Then type the following command to perform the backup.

mysqldump --opt --user='username' --password='password' --host='yourMySQLHostname' 'databasename' > 'nameofyourbackup.sql'

Database Restore Using SSH

First upload your backup file using FTP. Open SSH command window and type ‘cd’ followed by the directory path where your backup is placed.

Then type the following command to restore your backup.

mysql -h 'mysql.example.com' -u 'username' -p 'password' 'dbname' < 'databasefile.sql'

Share on Social Media

Related Posts

Volume Difference Between Standard And Micro Forex Accounts
Volume Difference Between Standard And Micro Forex Accounts
What Is MarkMonitor ?
What Is MarkMonitor ?
Who owns the Internet ?
Who owns the Internet ?
Encrypt your WiFi
Encrypt your WiFi
Arabs Write Arabic Using English Letters And Numbers Franco-Arabic
Arabs Write Arabic Using English Letters And Numbers Franco-Arabic
Guide to migrate Blogger mobile website to WordPress
Guide to migrate Blogger mobile website to WordPress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *