please help

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers please help
# 1  
Old 11-20-2001
Data please help

hi all,

I begin in Linux and I need change string in file.
I know the command grep for find the string in file but i don't know the command for change it Smilie

Please give me little exemple for my problem

thanx Smilie
# 2  
Old 11-20-2001
sed 's/search/replace/' <I>filename</I>

Result goes to standard out, so you can redirect it into a new file if you like.
# 3  
Old 11-20-2001
thanx very much.
# 4  
Old 11-20-2001
You can also, do it this way as well while in the file.

vi filename
:g /oldword/s//newword/g

Only one space after the first "g" and no other spaces. This will replace every instance in the file.
If you leave off the last "/g" it will only replace the next instance of the word you want to change.

Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question