Lab Assignment No.
6
AIM:
To study and implement redirecting input output, manual help, background
processing, managing multiple processes, changing process priority, implement and
practice filter related commands like sort, grep, sed, head, tail, cut, paste.
Theory:
1. Sort-
SORT 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. Using options
in sort command, it can also be used to sort numerically.
2. Grep-
The grep filter searches a file for a particular pattern of characters, and displays all
lines that contain that pattern. The pattern that is searched in the file is referred to as
the regular expression (grep stands for globally search for regular expression and
print out).
grep [options] pattern [files]
3. sed-
SED command in UNIX is stands for stream editor and it can perform lots of function
on file like, searching, find and replace, insertion or deletion. Though most common
use of SED command in UNIX is for substitution or for find and replace. By using
SED you can edit files even without opening it, which is much quicker way to find and
replace something in file, than first opening that file in VI Editor and then changing it.
4. Paste-
Paste command is one of the useful commands in Unix or Linux operating system. It
is used to join files horizontally (parallel merging) by outputting lines consisting of
lines from each file specified, separated by tab as delimiter, to the standard output.
When no file is specified, or put dash (“-“) instead of file name, paste reads from
standard input and gives output as it is until a interrupt command [Ctrl-c] is given