Created
July 14, 2011 18:58
-
-
Save miebach/1083152 to your computer and use it in GitHub Desktop.
Show only relevant lines in linux config files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat some.conf | sed 's/^[ \t]*//' |grep -v ^# | sed '/^$/d' | |
# as result all non-blank lines from some.conf that do not start with a "#" (which means this only a comment line) are printed to the terminal | |
# in short: show the lines that contain something relevant | |
# the first sed removes trailing spaces from all lines | |
# the grep removes all lines that start with a "#" | |
# the second sed removes all blank lines | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment