News
Centre of news

Archive for the ‘sed tips’ Category

Filter uncommented lines

Tuesday, January 5th, 2010

This will only print out the uncommented lines in source file.

Example

$ cat /etc/rc.d/rc.local | sed ‘/ *#/d; /^ *$/d’