Computer Science - Unix - Discussion

Discussion Forum : Unix - Section 2 (Q.No. 4)
4.
Which of the following is not a filter?
cat
grep
wc
sort
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
8 comments Page 1 of 1.

Debanuj said:   9 years ago
The cat is one of the most frequently used commands on Unix-like systems.

It is best known for its ability to display the contents of files rather than for its ability to transform them, and thus it might not initially appear to fall into the category of a filter.

However, it has the two additional (and not unrelated) functions of creating files and concatenating (i. e. combining) copies of them, which clearly makes it a filter.

In the next example, cat combines copies of file1, file2, and file3, and this is piped to wc, a filter which by default writes the number of bytes, words, and lines to the display monitor:

cat file1 file2 file3 | wc

Sainaveen said:   9 years ago
The cat is a filter because it filters all the files to find a particular file name.

Lata said:   1 decade ago
A filter is a program which can receive a flow of data from std input, process (or filter) it and send the result to the std output.

Numerous filters are included on Unix-like systems, a few of which are awk, cat, comm, csplit, cut, diff, expand, fold, grep, head, join, less, more, paste, sed, sort, spell, tail, tr, unexpanded, uniq and wc.

Gunsree said:   1 decade ago
No @Fareen you are wrong cat is also a filter. So the answer is none of the above.

Fareen said:   1 decade ago
Yes, I agree with the above comments cat is only used to display the contents of the file, so it's not a FILTER.

Balu said:   1 decade ago
Yes CAT command just display the data of the file. How can CAT be a filter. It doesn't sort data in the file.

Vidur said:   1 decade ago
How can CAT be a filter, as far as I am concerned it is used to print the data out to the console.

Barthlomew I C said:   1 decade ago
What is a filter? And give examples of it.

Post your comments here:

Your comments will be displayed after verification.