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

Which command is used to create a directory?

775


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

890


Name the unix command to find how many days the server has been up.

858


What is the function of grep command in unix?

793


Write a command that will display files in the current directory, in a colored, long format.

919


What is used to type command?

750


What is awk command used for?

781


What is the difference between grep and grep?

795


What is the use of the tee command?

806


What is .sh file?

837


Which command is used to kill the last background job?

1008


How do I use grep to search for a file?

781


What does sed command do in unix?

783


What is $0 bash?

886


Explain command to view process running?

809