Monthly Archives: May 2010

Strip comments and blank lines from file in Unix

This command displays configuration file stripping commented and blank lines on Unix-like operating system. grep -E -v ‘^\s*#|^\s*$|^\s*;’ file or egrep -v ‘^\s*#|^\s*$|^\s*;’ file