sed -i 's/fea/asd/g' hello.txt | sed "/bam/ s/foo/bar/" # Replace foo with bar on lines contain 'bam' | sed -i '1s/^/head2\n/' file1
sed -i 's/fea/asd/g' hello.txt
g: Global
s: substitute
-i : realtime works with file
---
sed "/bam/ s/foo/bar/" # Replace foo with bar only on lines that contain 'bam'.
#add text at the begining
Comments
Post a Comment