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