GNU Sed - Tasks 101 
// replacing commas for pipes in csv file
sed 's/,/|/g' original.csv > piped.txt

// alternate syntax to replace commas for pipes
cat original.csv | sed 's/,/|/g' > piped.txt

// printing lines that contain "Angel"
sed -n '/Angel/p' names.txt
grep "Angel" names.txt

// printing lines that contain "Angel" along with line number
cat -n names.txt | sed -n '/Angel/p'
grep -n "Angel" names.txt

// ...case-insensitive
cat -n names.txt | sed -n '/Angel/Ip'
grep -ni "Angel" names.txt




Finds all files and replace single quotes with double quoutes in place,sed is always greedy.
 find ./ -type f -exec sed -i -r "s/'playlist_us([\.a-zA-Z0-9]*)'/\"playlist_us\1\"/" {} \;


5/10/2018 - looks like the following is another way to accomplish the same crap
[acool@acool2 greenentre]$ find public/ -type f | xargs sed -i 's/\/6280\/Entre/\/6280\/greenEntre/g'

5/10/2018 - I also found the following interesting
grep -rl 'SearchString' ./ | xargs sed -i 's/REPLACESTRING/WITHTHIS/g'


Comments
Comments are not available for this entry.
2024 By Angel Cool