Filters

University of Wisconsin Madison

Computer Systems Lab CS1000

Wiscinfo
Wiscinfo
CS Home
CS Home
CSL
CSL
Feedback
CS1000
Feedback
Feedback

next up previous contents index
Next: Miscellaneous Commands Up: Getting Ahead Previous: Communication

Filters

 

As the name implies, a filter extracts information from a flowing stream of input. A filter is used by piping output into it. See section gif for an explanation of pipes. You can also specify a filename to each of these programs to use the contents of the file as input. Hence,

 

vega1% grep love wrongplace

is equivalent to

vega1% cat wrongplace | grep love

           

Filters
moredisplays contents by the screenful
head [-n]displays the first n lines (default is 10)
tail [-n]displays the last n lines (default is 10)
tail +ndisplays all lines starting with line n
grep stringprints all lines containing string
cut -ddelim -fndivides input lines into fields separated by delim and prints fieldn
sortalphabetically sorts input lines
sed scriptstream editor, basically a filter language



Caitlin Howell
Thu Jan 16 20:24:40 CST 1997