Filter commands in Linux

Linux Filter commands accept input data from stdin (standard input) and produce output on stdout (standard output). It transforms plain-text data into a meaningful way and can be used with pipes to perform higher operations.

These filters are very small programs that are designed for a specific function that can be used as building blocks.

Pipes (|)

A pipecommand is used by the shell to link the output of one command directly with the input of the other command. The pipe symbol is a vertical bar (|). The syntax is command1 [arguments] | command2 [arguments].

To get the listing of all files and directories, we shall use the command ls -l. Now, this command generally gives a long list of files. In order to get the last line of the output, we have the tail command. Let us add the |, to refine the result from the ls -l command and get only the last line.

The command is ls -l | tail -1 gets the last line.


Linux Filter Commands

  1. cat
  2. cut
  3. grep
  4. sed
  5. tee
  6. tr
  7. Uniq
  8. WC
  9. od
  10. sort
  11. head
  12. tail
  13. fmt
  14. more
  15. less
  16. find
  17. pr
0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions