The usual Linux commands

Source: Internet
Author: User

Some commands, if not commonly used, always remember, often used to check, hereby will be recorded in some of the commands here:

(1) Tar

Extract:
TAR-XVZF filename.tar.gz                 Decompression filename.tar.gz to the current folder-C can specify the extracted directory TAR-XVJF filename.tar.bz2                decompression filename.tar.bz2 To the current file tar-xvf Filename.tar                     unzip Filename.tar to the current folder (the tar end means not compressed) Unzip Filename.zip                        unzip Filename.zip to the current folder- D can specify the extracted directory

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

(2) Number of statistical files (excluding hidden files/folders)

Ls-l | grep "^-" | Wc-l                  count the number of files in the current directory LS-LR | grep "^-" | Wc-l statistics the number of files in the               current directory, including ls-l in subdirectories | grep "^d" | Wc-l                Statistics the number of folders (that is, directories) in the current directory Mesh LS-LR | grep "^d" | Wc-l              Statistics The number of folders (that is, directories) in the current directory, including subdirectories

The usual Linux commands

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.