Wednesday, 14 August 2013

What is Filter

Filter – It is a Linux command accepts its input from the standard input and produces its
output on standard output is know as a filter. A filter performs some kind of process on the input and gives output. For e.g.. Suppose we have file called ‘abc.txt’ with 100 lines data, And from ‘abc.txt’ we would like to print contains from line number 20 to line number 30 and store this result to file called ‘hlist’ then give command
$ tail +20 hlist
Here head is filter which takes its input from tail command (tail command start
selecting from line number 20 of given file i.e. abc.txt) and passes this lines to
input to head, whose output is redirected to ‘hlist’ file.

No comments:

Post a Comment