What is the difference between AWK and SED commands? Plz
give example and explain...

Answer Posted / chets

SED (which stands for Stream EDitor) is a simple but
powerful computer program used to apply various
pre-specified textual transformations to a sequential stream
of text data.
It reads input files line by line, edits each line according
to rules specified in its simple language (the sed script),
and then outputs the line.

AWK is a complete pattern scanning and processing language,
it is most commonly used as a Unix command-line filter to
reformat the output of other commands.
For example, to print only the second and sixth fields of
the date command (the month and year) with a space
separating them, at the Unix prompt, you would enter:
date | awk ‘{print $2 ” ” $6}’

Is This Answer Correct ?    80 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of tee command?

573


Which command is used to find whether the system is 32 bit or 64 bit?

633


How do you repeat a command in terminal?

598


What do know about tee command?

607


What are awk commands?

586






How to display no of records in oracle using unix command?

591


What is the command to find maximum memory taking process on the server?

674


What is the behavioural difference between cmp and diff commands?

682


How does shebang work?

594


How can you see the command line history?

588


What is the use of the tee command?

602


Why is grep called grep?

784


What is awk command used for?

602


Differentiate cat command from more command.

582


What is the size of time_t?

656