Linux File Viewing and content processing: pipeline operator command description and instance, linux Pipeline
1. Command description:
In Linux, the pipe character "|" is actually a fixed-size buffer with a size of 4 K bytes. Its function can regard the output content of a command as the input content of the next command. You only need to connect the two commands by using the pipeline.
2. instance:
For example, if you want to view the file details in the/usr/sbin directory, you can use the ls-l/usr/local command, however, this may cause screen flip due to too much output content. In this way, the output content is invisible to the screen. In fact, the pipeline function can be used to display the command output page by page using the more program.
[Root @ CentOS sbin] # ls-l/usr/sbin/| the total usage of more is 60976-rwxr-xr-x. 1 root 11240 December 2 2016 abrt-auto-reporting-rwxr-xr-x. 1 root 32408 December 2 2016 abrt-configuration-rwxr-xr-x. 1 root 31968 December 2 2016 abrtd-rwxr-xr-x. 1 root 31968 December 2 2016 abrt-release-rwxr-xr-x. 1 root 1347 December 2 2016 abrt-harvest-pstoreoops-rwxr-xr-x. 1 root 9671 December 2 2016 abrt-harvest-vmcore-rwxr-xr-x. 1 root 2914 December 2 2016 abrt-install-ccpp-hook-rwxr-xr-x. 1 root 27752 December 2 2016 abrt-serverlrwxrwxrwx. 1 root 10 October 10 14:38 accept-> cupsaccept-rwxr-xr-x. 1 root 11720 June 10 2014 accessdb-rwxr-xr-x. 1 root 11456 November 6 2016 accton-rwxr-xr-x. 1 root 135136 November 6 2016 adcli-rwxr-xr-x. 1 root 3126 October 4 2013 addgnupghome-rwxr-xr-x. 1 root 15864 November 6 2016 addpartlwxrwxrwx. 1 root 7 January 30 14:34 adduser-> useradd-rwxr-xr-x. 1 root 36864 November 6 2016 agetty-rwxr-xr-x. 1 root 3018 November 7 2016 alsabat-test.sh -- More --
As shown above, the content output by the ls-l/usr/sbin command is used as the input of the next command more through pipelines, so that you can conveniently view the output content.