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 difference between awk and grep?

631


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

711


What is pipe command in unix?

785


What are grep patterns?

674


How does pipe () work?

679






Who command in unix?

680


What is sed awk grep?

686


What is the nmap command?

686


What is the general format of unix command syntax?

781


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

781


Which command should you use to find the remaining disk space in unix server?

829


How do I delete files from command prompt?

659


Who invented grep?

737


How does the system know where one command ends and another begins?

1691


What is the unix command to confirm a remote host is alive or not?

669