Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17934

Find your missing config lines with this one weird old grep trick!

$
0
0

It was the usual sort of day, (up in ur srvr editin ur configs) and I swear I was going blind after reading this stupid file 100 times:

[root@mail ~]#cat /etc/lvm/lvm.conf |less ...blah blah blah 

For whatever reason, every time, my filter expressions are getting ignored. If you've ever edited this conf, it's about 8 lines that are important in about 800 lines of comments, which ordinarily is helpful, but in this case, I lost the code in the comments. Then I remembered a similar situation, and was very thankful I was not on Windows...

[root@mail ~]#cat /etc/lvm/lvm.conf |grep -v '#' <only config lines print out, comments ignored> 

Ohhh, yes. This reveals I forgot a closing brace, or deleted one, or commented it out. Every frakkin time.

TL;DR: use "grep -v '#'" to eliminate comments from your config files, leaving only the important lines, and you'll see where you messed it up.

submitted by notwithoutskills
[link][22 comments]

Viewing all articles
Browse latest Browse all 17934

Latest Images

Trending Articles



Latest Images