Grep for non-empty lines that do not start with # (comments) or and does not include

grep -v -e '^$' -e '^[#\[]' -e '\/' some_file
Grep for: >> non-empty lines : denoted by -v -e '^$' >> that do not start with # (comments) or : denoted by -v -e '^[#\]' >> and does not include : denoted by -v -e '\' (Note that we use -v only once)

By: abhikeny
2015-07-17 21:28:14

8 Alternatives + Submit Alt

What Others Think

Show a config file without comments, I don't think so config command have comments because until we don't have it means we never take it for us, At some of the places we will be keep reviews with all of these comments which you can take.
Lynetteodd · 70 weeks and 3 days ago
pay vendors
Romanorgan · 62 weeks and 5 days ago
great that i found this forum. People here are great. Learned alot. Keep posting more Cutting
Killersmile · 41 weeks and 6 days ago
Two full thumbs up for this magnificent article of yours. I've truly delighted in perusing this article today and I figure this may be outstanding amongst other article that I've perused yet. It would be ideal if you keep this work going ahead in a similar quality. Cookie Clicker
langworth · 4 weeks and 6 days ago
You can learn so many such commands through this website. All these commands will definitely knee joint pain make your tasks an easy one. The above command is used to show a config file without comments. I am looking here for more updates regarding such commands.
Alyssalauren · 1 week and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: