Linux File Viewing and content processing: pipeline operator command description and instance, linux Pipeline

Source: Internet
Author: User

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.

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.