Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

linux substitute string

#replace all string occurence
sed -i 's/old-text/new-text/g' input.txt 

#replace all string occurence and create new file
sed -i 's/old-text/new-text/g' input.txt > newfile.txt

#see link 
#https://www.cyberciti.biz/faq/how-to-use-sed-to-find-and-replace-text-in-files-in-linux-unix-shell/
 
PREVIOUS NEXT
Tagged: #linux #substitute #string
ADD COMMENT
Topic
Name
3+4 =