Usage of & quot;-& quot; in shell

Source: Internet
Author: User

The usage of "-" in shell tar-cvf-/home | tar-xvf-what is the meaning of the preceding command? In particular, the usage of several specific tar commands-www.2cto.com is not detailed. Copy/home to the current directory. -Cvf, followed by the tar command, indicates that the following letter is the option of the tar command. c Indicates packaging, v indicates displaying the execution process, and f indicates the file generated after packaging. Then, follow the minus sign next to f. Here it refers to the standard output stream. The first half of the sentence means to package/home in the output stream. Connect the second half with the pipe sign |. The first half of the output stream of www.2cto.com is used as the input parameter of the second half. The stream is represented by a minus sign here. The second half is the tar command. This time, option x is to unpackage. The complete last half of the sentence means to unpack the content in the input stream to the current directory. The effect of the entire sentence is the same as that of cp/home.

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.