• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

BASH> ‘sed’ command examples.

Nov15
2010
Written by Scott Rowley

Another list that will grow as I need it…

Remove blank lines from output

sed '/^$/d'

Replace data with new data

sed 's/DATA/NEWDATA/g'

Replace multiple spaces with single space

sed 's/ */ /g'

Replace first instance of string

sed -e 's/pattern/REPLACEMENT/1'
Posted in BASH, sed - Tagged blank, data, empty, output, replace, sed
« BASH> ‘find’ examples
» Perl> Useful one-liners

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top