3.0 UNIX Pipeline Commands

There are two basic command operators: Sequential ; 
and Pipeline (parallel) |

  cmd1 ; cmd2  		means that cmd1 is run first, totally finishes, 
				then cmd2 runs next, and totally finishes. 

The ; between two commands is identical to a <CR> in behavior.

  cmd1 | cmd2		means that both cmd1 and cmd2 start at the same 
				time, the output of cmd1 becomes the input to 
				cmd2 and then later cmd2 finishes running last.

Commands (filters) to learn:

head (1)		- display first few lines of specified files
more, less(1)		- file perusal filter for crt viewing
nl (1V)			- line numbering filter
fmt(1)			- simple optimal text formatter
rev (1)			- reverse the order of characters in each line
tail (1)		- display the last part of a file
tee (1)			- replicate the standard output
wc (1)			- display a count of lines, words and characters

Examples: (Try these on your UNIX system once newfile exists)

$ ls -la | more

$ cat newfile | wc
  
$ ls -lt | tee listfile | wc -l
 
$ cat listfile | nl | tail -10
  
$ cat newfile | head -15 | tee -a listfile | lp

Questions? Robert Katz: rkatz@ned.highline.edu
Last Update July 8, 2002