You are on page 1of 6

DEPARTMENT OF INFORMATION TECHNOLOGY

Semester S.E. Semester IV – Information Technology Engineering


Subject OS & UNIX Lab
Subject Professor In- Prof. Icchanshu Jaiswal
charge
Assisting Teachers -
Laboratory MS-Teams

Student Name Rohan Kadu


Roll Number 20101A0023
Grade and Subject
Teacher’s Signature

Experiment 2
Number
Experiment To study pipe and filter commands in UNIX.
Title
Resources / Hardware: Software:
Apparatus Basic Desktop with Windows or Jslinux,
Required Linux.
Objectives
(Skill Set /
Knowledge To study pipe and filter commands in UNIX.
Tested /
Imparted)
Theory 1. pipe | command
Pipes help combine two or more commands and are used as input/output
concepts in a command. To use the command, just type commands
separated by | in the Command Prompt.
Output:

2. grep, grep -v, grep -i


The grep filter searches a file for a particular pattern of characters, and
displays all lines that contain that pattern. -i : Ignores case for
matchmaking. -v : This prints all the lines that do not match the pattern.
Output:

3. wc:
Stands for word count. It is used to find out number of lines, word count,
byte and characters count in the files specified in the file arguments.
Output:

4. Redirection operator
This operator basically helps in diverting inputs and outputs.
• > is the standard output operator for overwriting in linux.
• >> is the standard output operator for appending a file in linux.
Output:

5. tr
Stands for translate. The tr command in UNIX is a command line utility for
translating or deleting characters.
Output;
6. sort
This command is used to sort a file, arranging the records in a particular
order. By default, the sort command sorts file assuming the contents are
ASCII
Output:

7. more
more command is used to view the text files in the command prompt,
displaying one screen at a time in case the file is large.
Output:
8. less
Less command is a Linux utility that can be used to read the contents of a
text file one page(one screen) at a time. It has faster access because if file
is large it doesn’t access the complete file, but accesses it page by page.
Output:
9. head
It is the complementary of Tail command. The head command, as the
name implies, print the top N number of data of the given input. By
default, it prints the first 10 lines of the specified files.
Output;

10. tail
It is the complementary of head command.The tail command, as the name
implies, print the last N number of data of the given input. By default it
prints the last 10 lines of the specified files.
Output;

11. uniq
The uniq command in Linux is a command-line utility that reports or filters
out the repeated lines in a file.
Output;

12. cut
The cut command in UNIX is a command for cutting out the sections from
each line of files and writing the result to standard output. It can be used
to cut parts of a line by byte position, character and field
Output;

Conclusion Pipe and filter commands were thoroughly studied.

You might also like