Pipe symbol, UNIX is a very powerful feature, the symbol is a vertical line: "|".
Usage: Command 1 | Command 2 His function is to pass the result of the first command 1 execution as input of the Command2 to command 2, for example: $ls-S|SORT-NR (Note that you do not copy the $ sign in.)
-S is the file size,-n is Numeric-sort,-r is reverse, reverses the command lists the document in the current directory (with size), and sends the output to the sort command as input, the sort command sorts the output of LS in descending order of numbers.
$ls-s|sort-n
Output in order from small to large.
Of course, you can also do several operations, such as the following function to remove the pure number, and then by SED to the vertical bar (here is not the pipe symbol) replaced by a space, then the results are taken out to sort, and then the results of the selection display, do not understand the sorting and paging can be seen.
Cat filename |grep-v ' ^[0-9]*$ ' | Sed ' s/|//g ' |sort-nrk 8-nrk9 |tail-n +1 |head-n 10
Vertical bars in the Linux Shell (|)--Pipe symbols