CentosSSH command Daquan, vps for beginners

Source: Internet
Author: User
Tags gz file ssh download
The following describes some basic commonly used LinuxSSH commands, which are some very simple LinuxSSH commands. the novice can master these commands and generally manage general 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/* & nbs

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-c http://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 = taojz ftp://www.taojz.com/taojz/* Download the vps directory from the host ftp://www.taojz.com and retain the directory structure, 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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.