Friday, 15 September 2017

how to search a keyword and replace in linux using vim text editor

[root@localhost ~]# vim testfile.txt
# go to the execution mode of vim
:%s/keyword/neword/ig
#option i is use for ignore case
#option g is use for global search
#only draw back is this will not match exact keywork you use this as
:%s/\<keywork\>/newword/ig
#this will match exact keyword and replace with new.

No comments:

Post a Comment

how to set time for internet use

this will allow internet access for a particular time interval. R4(config)#int f0/0 R4(config-if)#ip nat inside R4(config-...