Basic SSH Commands for Dedicated Web Host Server

ls: Show directory contents (list the names of files).
cd: Change Directory.
mkdir: Create a new folder (directory).
touch: Create a new file.
rm: Remove a file.
rm -rf * : Remove all files and directories
cat: Show contents of a file.
pwd: Show current directory (full path to where you are right now).

df -h: to check memory

cp: Copy file/folder.

mv public_html ~/shop.cybersecurity.com/ : To copy public_html, go first on this directory/home/dh_ejyi/earth.com/tms/homedir then run above command . Because public_html is exist in /home/dh_ejyi/earth.com/tms/homedir.

mv public_html* ~/shop.cybersecurity.com/ : To copy all files under public_html, go first on this directory/home/dh_ejyi/earth.com/tms/homedir then run above command . Because files of public_html is exist in /home/dh_ejyi/earth.com/tms/homedir.

To move files:
mv /home/dh_9uevtg/ithelpdesk.babylonit.com/ithelpdesk/* /home/dh_9uevtg/ithelpdesk.babylonit.com/

To copy files
cp -r /home/dh_9uevtg/ithelpdesk.babylonit.com/ithelpdesk/* /home/dh_9uevtg/ithelpdesk.babylonit.com/

To Downlad

mysqldump –opt –user=username -p –host=yourMySQLHostname –no-tablespaces dbname > nameofyourbackup.sql

Just replace the variable
username – database username
yourMySQLHostname – database hostname
dbname – database name
nameofyourbackup.sql – SQL file name you want it to be named as


mv: Move file/folder.

grep: Search for a specific phrase in file/lines.
find: Search files and directories.
vi/nano: Text editors.
history: Show last 50 used commands.
clear: Clear the terminal screen.
tar: Create & Unpack compressed archives.
wget: Download files from the internet.
du: Get file size.

cp -rp Halalbajar090421/halal/* Halalbajar090421/ : Copy all files of Halalbajar090421/halal/ into Halalbajar090421/ same like cp -rp shop.cybersecurity-earth.com/Halalbajar090421/* shop.cybers ecurity-earth.com/

zip -r hadisquran.com.zip hadisquran.com: This command will make zip folder in same directory.
unzip filename.zip: Unzip zip file
tar -xvf file_name.tar: Unzip tar file
tar -C /myfolder -xvf file_name.tar: Xtract to another directory

[vps52657]$ mysql -h mysql.ithelpdesk.babylonit.com -u ithelpdeskbabylo -p ithelpdesk_babylonit_com < babyloni_ithelpdeskp.sql

mysql -h mysql.ithelpdesk.babylonit.com -u ithelpdeskbabylo -p dbname < babyloni_ithelpdeskp.sql

Db Import: mysqldump –opt –user=username -p –host=yourMySQLHostname –no-tablespaces dbname > nameofyourbackup.sql

SubjectLink
UNIX commands — Working with directorieshelp.dreamhost.com/hc/en-us/articles/215465297-UNIX-commands-Working-with-directories
UNIX commands — Working with fileshelp.dreamhost.com/hc/en-us/articles/214750848-UNIX-commands-Working-with-files
WordPress.comwordpress.com/support/sftp/
Import DBhelp.dreamhost.com/hc/en-us/articles/221686207
Blue Hostbluehost.com/help/article/ssh-commands