# Unix - Filter Commands

I need to know concerning the "filter-command" which are readily available in Unix. I am perplexed concerning this:

1. What is the objective of "Filter-Command"?
2. Which are the Filter-commands readily available in Unix?

I have actually read some books/articles on internet, in some publications i located couple of filter commands and also in some publications i located a few other.

0
2019-05-04 21:09:05
Source Share

I'm not exactly sure what you're asking without context. "Traditional" Unix devices read from typical input and also contact typical result, so you can chain them with each other making use of a pipe, which is the | command :

 ls | grep "banana" | more


Points which read from typical input and also contact typical result are filters.

There is a write-up below : http://en.wikipedia.org/wiki/Filter_(Unix)

0
2019-05-08 07:15:30
Source

A filter command is virtually any kind of command line program on UNIX, actually.

Every program that can read from STDINand result to STDOUT can be made use of as filter.

There are exemptions, however. One such exemption is cpio, which takes a checklist of documents from STDIN to create an archive on result.

There are some commands, that appear not to be able to read from STDIN, though you need to examine whether those commands make use of - as documents parameter to read from STDIN or contact STDOUT, like cat :

$cat f - g  . Result f's materials, after that typical input, after that g's materials. Yet also when your program does not make use of that, you can still generally compel a program to work as a filter : For instance take wget and also you intend to make that program result to STDOUT : $ wget -O /dev/stdout http://stackoverflow.com/ | less

.

i.e. : . You can make use of /dev/stdin, /dev/stdout, and also /dev/stderr, as documents to compel a program to read, or result right into the standard-IO descriptors.

An additional side note : The size of your pipe, can be as long as you desire, so you can pipe from one program to an additional, primarily making it a lengthy chain of filters :

\$ cat file | xz | ccrypt &>/dev/null

.
0
2019-05-08 03:56:51
Source