Featured

    Featured Posts

Piping data between programs

In Linux, you can make one command’s output the standard input of another command. This process is called piping and it is done using the pipe symbol (|). Piping lets you have one command work on some data and then have the next command deal with the results.
Here is an example. We can use the ps -A command to list all process on the system:
linux ps a command
We can then pipe the output of the ps command to the sort command. This results in the following sorted output:
ps command piping
NOTE – we have used the -k 4 option to sort by the executable name (the fourth field).
We can pipe as many programs together as we like. For example, we could pipe the output of the ps -A | sort -k 4 command to the tail command to display only the last ten lines of the output:
linux piping more programs
author

Author Name

Author Description!

Get Free Email Updates to your Inbox!

Post a Comment

www.ccna.ma

yu
Powered by Blogger.

Translate

Copyright © Learn Linux Th3pro.xyz | Blogger Templates | Designed By Code TAOUSSI