Index of /andrejciho/Linux/Hide comments in conf files and scripts

Name Last modified Comments Description

Back Parent Directory

Hide comments in conf files and scripts

Sometimes when I look at different .conf files or scripts, comments cluttering up my terminal bother me - I just want to see the real stuff. So I perled myself a little script, added to a pathed folder and now I can just type for example:
nocomment /etc/smb.conf
and voila - no junk in my terminal. And if I want to output that to a file instead of terminal…
nocomment /etc/smb.conf > /etc/smb.conf.new
Here's the simple script called nocomment

Comments (2) to “Hide comments in conf files and scripts”

  1. grep -v '^[#;]' /etc/smb.conf

  2. I knew there was a geekier way :) Thanks Dave.


Leave a Comment
*Required
*Required (Never published)
 

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image