Professional Documents
Culture Documents
Group-39 PPT Linux
Group-39 PPT Linux
Group-39 PPT Linux
FILTERS IN LINUX
WHAT ARE FILTERS?
TYPES OF FILTERS IN
LINUX
- There are Mainly 12
Type of Filters:
-
1.
Some of them are
Cat
2. Cut
3. Grep
4. Comm
5. Sort
6. Uniq
1.CAT
- Displays the text of the file line
by line.
- Syntax:
cat <fileName> | cat or tac |
cat or tac |.
- Example:
- cat weeks.txt| tac | cat | cat
| tac
2.COMM
- The Comm Command compares
two files or streams.
- By default ‘comm’ will always
display three columns.
- First column displays non
matching files of first file, second
column indicates non matching
items of second file, and third
column indicates matching items
of both the files.
- Both the files has to be sorted
order for ‘comm’ command to be
executed
- Syntax: comm <file1> <file2>
- Example: comm file1.txt
file2.txt
3.TR
- The Command ‘tr’ stands
for ‘translate’.
- It is used to translate, like
from lowercase to
uppercase and vice versa
or new lines into spaces.
- Syntax:
command | tr <‘old> <‘new’>
- Example:
cat exm.txt | tr ‘prcu’ ‘PRCU’
4.OD
- The ‘od’ terms stands for octal dump.
- It displays content of a file in different
human readable formats like
hexadecimal, octal and ASCII
characters.
- Syntax:
- Example
5.SORT
- The Linux ‘SORT’
command sorts the file
content in an
alphabetical order .
- Syntax
sort <fileName>
- Example
sort weeks.txt
6.GZIP
- Gzip (GNU Zip) is a
compressing tool, which is
used to truncate the file size.
- By default original file size will
be replaced by the
compressed file ending with
extension (.gz).
- To decompress a file you can
use gunzip command and
your original file will be back.
- Syntax
gzip <file1> <file2> <file3>
gunzip <file1> <file2> <file3>
- Example
gzip file1.txt file2.txt
gunzip file1.txt file2.txt
CONCLUSION
IN COMPUTER PROGRAMMING, A FILTER IS A PROGRAM OR
SECTION OF CODE THAT IS DESIGNED TO EXAMINE EACH
INPUT OR OUTPUT REQUEST FOR CERTAIN QUALIFYING
CRITERIA AND THEN PROCESS OR FORWARD IT ACCORDINGLY.
THIS TERM WAS USED IN UNIX SYSTEMS AND IS NOW USED IN
OTHER OPERATING SYSTEMS.
REFERENCES
https://www.javatpoint.com/linux-filters
https://www.geeksforgeeks.org/filters-in-linux/amp/