Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Some useful sed commands  (Read 3541 times)

0 Members and 1 Guest are viewing this topic.

dustin

  • Guest
Some useful sed commands
« on: November 01, 2013, 06:59:06 pm »

To remove the first line of a file from our output stream

$ sed -e '1d' filename | more

To delete lines 1-10 of the output

$ sed -e '1,10d' filename | more

To delete lines that start with a "#" from files

$ sed -e '/^#/d' filename | more

To print only virtualHosts in apache conf

$ sed -n '/^ /pathto/httpd.conf