Common Linux commands and common Linux commands

Source: Internet
Author: User

Common Linux commands and common Linux commands

If some commands are not commonly used, you can't remember them. Every time you use them, you need to query them. Here we record some commands:

(1) tar

Decompress:
Tar-xvzf filename.tar.gz unzip filename.tar.gz to the current folder-C you can specify the decompressed directory tar-xvjf unzip to the current file tar-xvf filename.tar decompress filename.tar to the current folder (the end of tar indicates compression) unzip filename.zip decompress filename.zip to the current folder.-d specifies the directory to be decompressed.

 

Compression:
Tar-cvzf filename.tar.gz. Use gzip to compress files and folders in the current directory tar-cvjf filename.tar.bz2. Use bzip2 to compress zip file.zip. Use zip to compress files.

 

 

(2) count the number of files (excluding hidden files/folders)

Ls-l | grep "^-" | wc-l count the number of files in the current directory ls-lR | grep "^-" | wc-l count the number of files in the current directory, including ls-l | grep "^ d" | wc-l in the subdirectory to count the folder under the current directory (that is, the directory) number of ls-lR | grep "^ d" | wc-l counts the number of folders (I .e. Directories) in the current directory, including

 

 

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.