![]() |
Computer Systems Lab CS1000 |
![]() Wiscinfo |
![]() CS Home |
![]() CSL |
![]() CS1000 |
![]() Feedback |
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
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 | |
---|---|
more | displays 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 +n | displays all lines starting with line n |
grep string | prints all lines containing string |
cut -ddelim -fn | divides input lines into fields separated by delim and prints fieldn |
sort | alphabetically sorts input lines |
sed script | stream editor, basically a filter language |