Example 3-5: Simple pipelines.Some examples of simple pipes:
ls -al | more Produce a long listing of all files in the current directory, and pass the output into the “more” command so that it will be displayed only one page at a time on the computer screen. ps -ef | more Create a full listing of every process running on the computer, and allow the “more” command to control the output as it is displayed on your screen. who | wc -l Pipe the output of the who command into the input of the wc -l command (this counts the number of lines of input). This tells you the number of users currently logged in.
Next: An example of a Up: Combining UNIX Commands Previous: Creating Pipelines   Contents |