Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

sed add word to beginning of line

$ sed 's/^/#/' file.txt
#add
#character
#at the
#beginning of
#each line
Comment

sed add word to end of line

sed 's/.*/&:80/'  abcd.txt >abcde.txt
Comment

add string at end of line sed

# Save suffixed file into a new file
sed -e 's/$/suffix/' file > file.new

# Edit file and overwrite with suffixed text
sed -i -e 's/$/suffix/' file
Comment

PREVIOUS NEXT
Code Example
Shell ::  
Shell ::  
Shell :: uniq linux 
Shell ::  
::  
::  
::  
::  
::  
::  
::  
Shell ::  
Shell ::  
::  
Shell :: remove commits from github 
:: how to install mono on ubuntui 
Shell ::  
Shell ::  
Shell ::  
:: aab to apk 
Shell ::  
Shell :: gcloud shell ssh 
::  
:: bash count elements in string 
:: install tar.xz in ubuntu 20.4 
::  
Shell ::  
::  
:: install mongo ubuntu 20.04 
Shell ::  
ADD CONTENT
Topic
Content
Source link
Name
9+2 =