SSH basic commands

 

We have listed some SSH Basic Commands and their uses. Kindly be guided by the information below.

(Note: For Virtual Private Servers and Dedicated Server Hosting package only.)

SSH Basic Commands
 Meaning
 cd /directory To go to a specific directory (Replace directory with the correct directory name.)
cd .. Allows you to go one directory up.
cd ~ To go back to the home directory.
vi filename.extension To edit or view a current file. (Replace filename.extension with the correct file name information.)
(press esc) :x!

(press esc) :q!

 To save the changes to the file and quit the editor.

To quit the editor without saving the changes.

(Both are only used when editing or viewing the content of the file through the vi command.)

 mkdir /newdirectory  To make a new directory. (Replace newdirectory with the correct new directory name.)
ls -alh  To view the list of the files inside the current directory.
chmod 000 filename.extension To change a file permission. (Replace 000 with the correct permission number and filename.extension with the correct file name. Please take note that the default working permission for a file is 644 and for a folder is 755.)
pwd To check your current directory.
cp filename.extension newdirectory/filename.extension To copy a file to a different directory (Replace filename.extension with the correct file name information and newdirectory with the correct new directory name.)
cp filename.extension directory/newfile.extension To copy the file but with a different file name. (Replace filename.extension with the correct file name information directory with the correct directory name and newfile.extension with the correct new file name.)
cp -R /directory /newdirectory To copy the entire folder to another folder. Please also take note that this does not copy the hidden files like .htaccess or any file that starts with the period (.) sign.
 top -c  To have a live overview of your processes running on the server and the current load on a server.
 df -h  To view amount of disk space on the server.
 free -m   To see current and total memory usage.
 php -v  To check server’s PHP version.
 mv filename.extension /directorypath/filename.extension

 

mv filename.extension newfilename.extension

This will move the file into a specific directory. (Replace filename.extension with the correct file name information and directorypath with the correct directory.)

To rename the file name.  (Replace filename.extension and newfilename.extension to the proper file names.)

 

 

Do not hesitate to contact our support team if you have further questions.

SSH basic commands

Leave A Comment?