Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sed command syntax with example

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to know the (sed) command syntax and the usage. suppose I have a file like this

file content
-------------------
abc
def
xxx
yyy

I want to change the particular word say 'xxx' to 'www' without doing in vi editor, I think I can use the sed command right, please send me the syntax with an ex.
(mail me on bsmurugavel@yahoo.com)
 
sed syntax,

Try this:

[tt] sed 's/xxx/ < file.txt > file.out[/tt]

The command string means to substitute all occurrences of 'xxx' with ' The 'g' means global, which makes it replace more than one occurrence on each line (if present).

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top