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 awk command used for?

596


What does the command '$ls | wc –l > file1' do?

676


How to use grep command to list find the records of a file containing 10 different strings?

643


Which command is used to restrict incoming messages?

590


Does cp command overwrite files?

617






What is pipe command in unix?

668


Can you explain a little bit about command substitution?

605


Explain command to view process running?

611


What is s and g in sed command?

555


What is the use of awk command in unix?

577


What does grep v grep do?

547


Who command in unix?

569


What is the command to view process running?

572


What does this command do? Cat food 1 > kitty

974


What does touch command do in unix?

722