Search
 
SCRIPT & CODE EXAMPLE
 

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/
Comment

PREVIOUS NEXT
Code Example
Shell :: how to isnatll snap on ubuntu linux 
Shell :: display branch name in terminal ubuntu 
Shell :: E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) 
Shell :: how to install mypy 
Shell :: apache2 change directory root 
Shell :: bash vlookup function 
Shell :: saml2aws logout 
Shell :: bash generate random number between 1 10 
Shell :: how to check in a library if it is installed in conda 
Shell :: git check staged changes 
Shell :: exec user process caused: exec format error 
Shell :: powershell command history file 
Shell :: open a folder linux 
Shell :: find branches in git 
Shell :: express-generator ejs 
Shell :: wslinux backup 
Shell :: remove apt docker 
Shell :: if else in mac terminal 
Shell :: reset one branch onto another 
Shell :: changeset in jenkins pipeline 
Shell :: get current commit message git 
Shell :: how to give all permission to a directory in linux 
Shell :: linux check if dir is mounted 
Shell :: docker sleep infinity 
Shell :: remove all games ubuntu 
Shell :: remove last commit git 
Shell :: aws cli ec2 list security groups 
Shell :: github setup 
Shell :: vercel cli 
Shell :: awk how to print without adding spaces between fields 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =