Thursday, June 16, 2016

Remove comments and empty line from a text file

cat <file_name> | grep -v "^#" | grep -v '^$'

This command will remove empty lines and any line starts with #.

No comments:

Post a Comment