A slightly more complex operation on a Linux Traditional Chinese medicine requires the use of a piping command "|" A combination of multiple commands, in the following form:
Command 1 | Command 2 | Command 3 ...
Some commands in Linux can be used directly in pipeline commands, some of which are not, and for commands that cannot be used directly for pipelines, you need to use the Xargs command:
- Find./-type F | Xargs md5sum >> Md5_rc1.txt
- Find./-type f-print| Xargs md5sum >> Md5_rc1.txt
- Find./-type f-print0| xargs-0 md5sum >> Md5_rc1.txt
Where the first and second results are similar, the third applies to files with spaces in the file name. The principle is: usually xargs for the partition file is the default: space, TAB, newline characters, etc.,-PRINT0 is a null partition file, xargs-0 is null to distinguish the file partition
And for the command that can be used directly to the pipeline, do not need to write directly to the Xargs can be written directly behind the pipe character can be judged, such as to determine whether the WC command can be used directly in the pipeline command
Ls-l | Wc-l
For common commands that can be used directly in pipelines, there are:
- Cut
- Grep
- Sort
- Uniq
- Wc
- Tee
- Tr
- Col
- Join
- Paste
- Expand
- Xargs
The specific usage and parameters of the command can be referenced
Http://www.cnblogs.com/lemonbar/archive/2014/08/24/3933390.html
Summary of commands available for pipeline operations in Linux