- Replace a line with specific text:
ls -al | sed -e '/swp$/c\TEMPORARY FILE'
- only want to change a few words?
- replace first occurance on any line:
ls -al | sed -e 's/old/new'
- replace all occurances on any line:
ls -al | sed -e 's/old/new/g'
- combine with search!
- ls -al | sed -e'/html$/s/rw-r--r--/644/'
NEXT
PREVIOUS
Master Index