What is Replace Command .

User avatar
SammieEG
Posts: 27
Joined: Tue Feb 25, 2014 11:46 am

What is Replace Command .

Postby SammieEG » Tue Mar 04, 2014 8:55 am

Below is solution to replace Specific word.

Suppose we have to replace word "four " by "three".

root@root [~]# cat file
one two four
one two four
one two four
one two four
one two four

root@root [~]# replace four three -- file
file converted

root@root [~]# cat file
one two three
one two three
one two three
one two three
one two three

And the word four get replaced by three.

Thank you :)

User avatar
markjacks
Posts: 82
Joined: Sun Nov 30, 2014 11:56 pm

Re: What is Replace Command .

Postby markjacks » Tue Jul 14, 2015 3:57 pm

Nice trick! This could be very useful setting up as cronjob so we would make corrections on files automatically.
Data back up is a must. Image


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest