What is use of sed command?
Answers were Sorted based on User's Feedback
Answer / surya
sed is a stream editor for editing files from a script or from
the command line
Is This Answer Correct ? | 34 Yes | 0 No |
Answer / naren
sed -e 's/oldstuff/newstuff/g' inputFileName >
outputFileName
Is This Answer Correct ? | 10 Yes | 0 No |
Answer / vandanaverma_2
sed reads the standard input into the pattern space,
performs a sequence of editing commands on the pattern
space, then writes the pattern space to STDOUT.
Is This Answer Correct ? | 14 Yes | 5 No |
Answer / varakumar
The sed utility is a stream editor that reads one or more
text files, makes editing changes according to a
script of
editing commands, and writes the results to standard
output.
The script is obtained from either the script
operand
string, or a combination of the option-arguments from
the -e
script and -f script_file options.
The sed utility is a text editor. It cannot edit
binary
files or files containing ASCII NUL (\0) characters
or very
long lines.
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / sneha
sed is stream editor.It is use to change one string of text
to another text.
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / sumitabha das
sed is a multipurpose tool which combines the work of
several filters.
sed uses instructions to act on text.
AN instruction combines an address for selecting lines with
an action to be taken on then , as shown by the syntax
sed options 'address action' file(s)
Is This Answer Correct ? | 7 Yes | 2 No |
Usage: sed [OPTION]... {script-only-if-no-other-script}
[input-file]...
-n, --quiet, --silent
suppress automatic printing of pattern space
-e script, --expression=script
add the script to the commands to be executed
-f script-file, --file=script-file
add the contents of script-file to the
commands to be executed
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if
extension supplied)
-c, --copy
use copy instead of rename when shuffling
files in -i mode
(avoids change of input file ownership)
-l N, --line-length=N
specify the desired line-wrap length for
the `l' command
--posix
disable all GNU extensions.
-r, --regexp-extended
use extended regular expressions in the script.
-s, --separate
consider files as separate rather than as a
single continuous
long stream.
-u, --unbuffered
load minimal amounts of data from the input
files and flush
the output buffers more often
--help display this help and exit
--version output version information and exit
If no -e, --expression, -f, or --file option is given, then
the first
non-option argument is taken as the sed script to interpret.
All
remaining arguments are names of input files; if no input
files are
specified, then the standard input is read.
E-mail bug reports to: bonzini@gnu.org .
Be sure to include the word ``sed'' somewhere in the
``Subject:'' field.
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / kumar akhila
sed reads the standard input into the pattern space,
performs a sequence of editing commands on the pattern
space, then writes the pattern space to STDOUT.
Is This Answer Correct ? | 7 Yes | 3 No |
Answer / sujit
sed is use to replace a character string with a defferent
string
syntax of "sed"
sed s/oldstring/newstring/filename
example
sed s/sujit/ajit/abc.old>abc
it means string sujit change into ajit which placed in file
abc.old
Is This Answer Correct ? | 3 Yes | 0 No |
what is the command to list all files in a directory, including the hidden files in UNIX ?
What is the use of touch command in there?
What is merge command in unix?
what is virtual machine?
How does shebang work?
What is the use of find command in unix?
How does the system know where one command ends and another begins?
What are filter commands in unix?
Hi All, Can you please let me know how to grep for a particular pattern in unix. I want to print the dates from the file exp.txt. the date pattern is DD:MM:YYYY, I just want to print all the dates from the file exp.txt.
8 Answers Concentrix, IBM, Symantec, TCS,
fork in unix ?
what is the use of "grep" command?
What is {} in find command?