Admins eHow SysAdmin Tips & Tricks

June 22, 2009

Remove comments and empty lines on linux using sed command

Filed under: CentOS,Debian,General — Tags: , , , , — admin @ 10:24 am
sed -e 's/#.*//' -e 's/[ ^I]*$//' -e '/^$/ d' filename
  • Sara

    Pretty nice post. I just came by your blog and wanted to say
    that I’ve really liked reading your posts. Any way
    I’ll be subscribing to your feed and I hope you write again soon!

Powered by WordPress