The pipeline command of Linux operation tool

Source: Internet
Author: User

Pipeline command

Pipeline Command : As the name implies, mainly in the pipeline , meaning is to put something through a pipe, into the way you want to look, the pipeline is equivalent to a filter , leaving what you want to see.

The pipeline command under Linux uses a ' | ' Delimiter, which is formatted as ' command | command ', that is, the output of the previous command as input to the second command, the second command is generally a document selection command.

Select command Cut,grepcut to process documents by row

Parameters:
*-D followed by delimiters
*-F followed by number paragraph
*-C Take out the first paragraph in a character unit

For example:

$:echo$PATH

/home/work/.jumbo/bin/core_perl:/home/work/.jumbo/bin:/home/op/opbin/optool/bin:/usr/kerberos/bin:/usr/local/ Bin:/bin:/usr/bin:/usr/x11r6/bin:/usr/share/baidu/bin:/opt/bin:/home/opt/bin:/home/work/bin:/home/work/php/bin :/home/opt/gcc-4.8.2.bpkg-r2/gcc-4.8.2.bpkg-r2/include/c++/4.8.2/
It is found that there are several parts, each of which is separated with ': ' so that it can be processed with cut

$:echo$PATH-d‘:‘-f5

/usr/local/bin
Remove the 5th paragraph with ': ' As the delimiter

$:echo$PATH-d‘:‘-f -5

/home/work/.jumbo/bin/core_perl:/home/work/.jumbo/bin:/home/op/opbin/optool/bin:/usr/kerberos/bin:/usr/local/ Bin
Take out the first 5 parts, and note that the '-' here indicates all previous

$:$PATH-d‘:‘-f3,5

/home/op/opbin/optool/bin:/usr/local/bin

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The pipeline command of Linux operation tool

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.