The following describes some basic common Linux SSH commands, which are some simple Linux SSH commands. The novice can master these commands and generally manage common vps or linux Hosts!
Our tutorial introduces how to use putty. If you don't want to use putty, you can check it. It's very easy.
1. Restart command:
Reboot/* restart the system */
Service httpd restart/* restart Apache */
Service lighttpd restart/* restart lighttpd */
2. Some SSH folder commands in Linux;
Rm-rf mydir/* Delete the directory of mydir */
Cd mydir/* enter the mydir directory */
Cd-/* Go back to the upper-level directory with spaces in the middle */
Cd ~ /* Return to the root directory with spaces in the middle */
Mv a B/* rename file name a to B */
Cp-a tool/home/admin/taojz/* Copy all files under the tool directory to the taojz directory */
Rm taojz.tar/* delete the file taojz.tar */
Find taojz. cgi/* find the file named taojz. cgi */
Df-h/* view the remaining disk space, which is almost useless */
3. Unzip SSH in Linux and compress the command:
Tar xvf taojz.tar/* decompress the taojz.tar file */
Tar-tvf taojz.tar/* files contained in the taojz.tar file */
Gzip-d taojz.tar.gz/* decompress the taojz.tar.gzfile as a .tar file */
Tar zxvf taojz.tar.gz/* decompress taojz.tar.gz to the current directory */
Unzip taojz.zip/* decompress the taojz.zip file */
Tar cf taojz.tar taojz/* pack the taojzdirectory as a taojz.tar file */
Tar cfz taojz.tar.gz taojz/* pack the taojzfile and compress it into a taojz.tar.gz file */
Note: tar.gz has a large proportion of compression because tar.gz has not been compressed.
4. SSH download command:
Wget http://www.www.taojz.com/download/taojz.tar.gz
/* Remotely download the taojz.tar.gz on the remote server in the service.
Files, website transfer, and software installation are commonly used, and the upload speed is much faster than ftp */
Wget-chttp: // www.taojz.com/download/taojz.tar.gz/* continue to download the last undownloaded file */
Nohup wget http://www.taojz.com/download/taojz.tar.gz/* close SSH to continue downloading files */
Wget-nH-cut-dirs = 1-m-ftp-user = taojz-ftp-password = taojzftp: // www.taojz.com/taojz/* download the vps directory from the host ftp://www.taojz.com, and the directory structure is retained, suitable for virtual hosts that cannot be compressed */
-NH:/* do not create a directory named after the host name. */
-Cut-dirs:/* ignore the directory layers on the host. */
-M:/* download all subdirectories and keep the directory structure. */
-Ftp-user:/* FTP user name */
-Ftp-password:/* FTP password */
Ftp: // host domain name or ip/directory name/* FTP host address. Finally, you can download the specified directory with the directory name */
5. modify attributes of files and folders. Many programs need to set attributes for use. If ftp cannot be modified, use the SSH command to modify the attributes!
-Chmod: change file/folder Permissions
Chmod [Mode] [dir]/* Where the Mode is like "755" or "777. Based on your program needs */
Chmod-R [Mode] [dir]/* recursively, changing the permissions of all files in the target folder */
Of course, there are more Linux SSH commands, which are commonly used by new users and are easy to master. If you use them several times, you will find that ssh commands are much more efficient than control panel commands!