For novices only, veterans please don’t read this! With these commands, there is basically no problem using a VPS, that's what I do :) 【cd】 The cd command not only displays the current status, but also changes the current status. The cd in Linux is similar to that in DOS. #cd /home/wwwroot (enter the /home/wwwroot directory) #cd .. (enter the previous directory) #cd – (Enter the last directory entered) #cd / (enter the root directory) 【tar】 The tar command is commonly used in the packaging, backup and decompression process in VPS. #tar cvf a.tar.gz *.* (Pack all files in the current directory and compress them into a.tar.gz file) #tar cvf a.tar.gz /home (pack all files in the home folder and compress them into the file name a.tar.gz) #tar xvf a.tar.gz (decompress a.tar.gz to the current folder, you can also use zxvf) #tar tvf a.tar.gz (browse the files in the a.tar.gz compressed package) 【rm】 rm is the delete command in Linux. #rm a.tar.gz (delete a.tar.gz, then a confirmation message will appear, enter y) #rm –r (delete directories one by one and confirm) #rm –rf (forced deletion, no confirmation) 【ls】 ls is equivalent to dir in DOS command, which lists the files in the current directory. (Note: dir can also be used in Linux) #ls (list directory files) #ls –l (list files and display detailed information) #ls -l |more (too many directories to display on split screen) 【mv】 mv is the same as move, but it also has the function of renaming. #mv a.tar.gz /home (move a.tar.gz in the current directory to the home directory) #mv a.tar.gz b.tar.gz (rename a.tar.gz to b.tar.gz) 【cp】 The full name of cp is copy, which naturally means copy. #cp a.tar.g /home (Copy a.tar.gz in the directory to the home directory. You can select multiple files at a time. Just add the file name after cp) #cp –R (copy the entire directory, including subdirectories) Other commands #mkdir (create directory) #su (Switch User) #pwd (display the user's current directory) #wget (download from source file) #ftp (Connect to FTP) #passwd (Change password) #reboot (reboot) #restart (*Also means restart, e.g. /lnmp/root restart)
|