Please consult with public documentation for how to use SSH (secure shell) or Unix/Linux command line. One useful resource is http://ss64.com/bash/ and plenty of other ones can be found through the search engines.
Here are some basics you are sure to need!
Accessing Shell
You are going to need a terminal where you can type command line. Alternatively, you can use a program such as PuTTY or WinSCP.
On some plans, such as shared and reseller plans, you may need to have SSH access activated first. On most accounts shell access is turned off by default to help prevent authorized access. Please read our article on How do I get and use SSH access? for complete details.
Login to your server
With a program like PuTTY, this is super easy. Just type your domain name or server IP address for the Host field, and 22 for the Port, then click the Open button.
In terminal, type this: (Be sure to replace USER with your primary username, and replace SERVER with the server IP or your domain name.)
For shared and reseller plans, you would have to use:
Now you will be prompted for your primary user's password. You may not see the characters as you type them, or when you paste from your clipboard; that is normal.
View directory
In terminal or PuTTY, type this:
Now you see a list of all the files and subdirectories, along with details.
Some of our servers, like shared & reseller servers have a shortcut (alias) for the same detailed list:
This shortcut (alias) may not be setup on all servers, such as VPS or dedicated. You can setup this alias with the command: alias ll='ls -la'
Navigate directories
This command takes you inside the named directory, where you can list the files to see what's inside: (Be sure to replace FOLDER with the actual directory name.)
You can move deep into the file structure if you know the path: (Be sure to replace FOLDER/PATH/ETC with the actual directory path.)
You can easily move up one directory with this:
You can easily move back to the previous directory you were in with this:
View a file
This command allows you to view a file without any possibility of modifying it: (Be sure to replace FILE.NAME with the actual file name.)
Create a file
This command creates a file if one does not exist, or changes the timestamp on an existing file: (Be sure to replace FILE.NAME with the desired file name.)
Delete a file
This command permanently removes files, so use with caution: (Be sure to replace FILE.NAME with the desired file name.)
Edit a file
These commands allow you to edit a file, so be careful: (Be sure to replace FILE.NAME with the desired file name.)
or
There are other popular editors, and you must chose which editor you are comfortable with.
Access MySQL
This command takes you to MySQL, where you can type SQL syntax: (Be sure to replace USER with your primary username or database user, and replace DB_NAME with the actual database name.)
Now you will be prompted for your primary password or database user's password.
Once logged into MySQL, you will see a mysql> prompt.
View Databases
At the mysql> prompt, type this:
View Tables
At the mysql> prompt, type this: (Be sure to replace DB_NAME with the actual database name, hit Enter, then type the rest.)
show tables;
View Table Attributes
At the mysql> prompt, type this: (Be sure to replace DB_NAME with the actual database name, hit Enter, then type the rest while replacing TABLE with the actual table name.)
describe TABLE;
MySQL queries
At the mysql> prompt, type the SQL query as you normally would.
Exit MySQL
Export a Database
This must be done in the normal prompt, not the mysql> prompt. Just be sure to exit MySQL if you are in it. (Be sure to replace USER with your primary username or database user, replace DB_NAME with the actual database name, and replace FILE with the desired backup file name.) You will be prompted for your password.
Import a Database
This must be done in the normal prompt, not the mysql> prompt. Just be sure to exit MySQL if you are in it. (Be sure to replace USER with your primary username or database user, replace DB_NAME with the actual database name, and replace FILE with the known backup file name.) You will be prompted for your password.
For more commands you will need, please refer to our related article, "Shell Commands".


