A number of these mimic the function and features of the filters in Unix. Some of these are freeware, some shareware and some are commercial programs. Such filters may be used in batch files (*.bat, *.cmd etc.).įor use in the same command shell environment, there are many more filters available than those built into Windows.
Two standard filters from the early days of DOS-based computers are find and sort. grep at its simplest prints any lines containing a character string to its output. The classic filter in Unix is Ken Thompson's grep, which Doug McIlroy cites as what "ingrained the tools outlook irrevocably" in the operating system, with later tools imitating it. The Unix philosophy encourages combining small, discrete tools to accomplish larger tasks. This operator signifies that the main output of the command to the left is passed as main input to the command on the right. Filters may be strung together into a pipeline with the pipe operator (" |"). To append data lines to an existing output file, one can use the append operator ( >). The command syntax for getting data from a device or file other than standard input is the input operator ( ). Auxiliary input may come from command line flags or configuration files, while auxiliary output may go to standard error. In Unix and Unix-like operating systems, a filter is a program that gets most of its data from its standard input (the main input stream) and writes its main results to its standard output (the main output stream).