Jan 172010
Remove comments (#) and empty lines in a file
Answer:
To quickly remove comments (#) and empty lines in a file, with the help of egrep
# egrep -v '^[ \t]*#|^$' text.txt
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Remove comments (#) and empty lines in a file
Answer:
To quickly remove comments (#) and empty lines in a file, with the help of egrep
# egrep -v '^[ \t]*#|^$' text.txt