Professional Documents
Culture Documents
2. Task to be done:
Implementation of commands such as:head, tail, sed, uniq, wc, sort, cut, cat, tac
3. Concept used:
head: head is used to display the first parts of a file, it outputs the first 10 lines by default. We can use the –n
to display the desired number of lines.
tail: It is the complimentary of head command. tail outputs the last parts (10 lines by default) of a file. We
can use the -n num switch to specify the number of lines to be displayed.
sed: Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream
uniq: uniq command is used to report or omit repeated lines, it filters lines from standard input and writes
the outcome to standard output.
wc: wc command is used to count words, lines and characters for each file.
sort: The sort filter (alphabetical sort) is used to sort lines of text files.
cut: cut command is used to cut out selected fields (columns) of each line of a file, depending on a delimiter
or a count of bytes.
cat: The cat (short for “concatenate“) command is one of the most frequently used command in Linux/Unix
like operating systems. cat command allows us to create single or multiple files, view contain of file,
concatenate files and redirect output in terminal or files.
tac: tac command in Linux is used to concatenate and print files in reverse.
4. Steps/Commands involved to perform practical:
Head: Syntax- $head <filename>
Tail: Syntax- $tail <filename>
Sed: Syntax- $sed “s/<>/<>/g” <filename>
Uniq: Syntax- $sort <filename> | uniq –c
WC: Syntax-$wc<filename>
Sort: Syntax- $sort <filename>
Cut: Syntax- $cut –c <coloumn><filename>
Cat: Syntax- $cat <filename>>><filename>
Tac: Syntax- $tac <filename>
5. Result/Output/Writing Summary:
Evaluation Grid: