Filter

From LQWiki
Jump to navigation Jump to search

A filter is a program used to transform data in a pipe. For instance,

$ grep -v ^\# $IN | cut -d\/ -f6 | sort -k2 >> $OUT

Grep reads out only the uncommented portion of $IN and cut selects elements from each line, and sort processes them in order, resulting in $OUT. Filters are frequently used in Unix text processing, in anything from formatting man pages to preparing documents for printing.

This article is a stub and needs to be finished. Plunge forward and help it grow!