Skip to content

Instantly share code, notes, and snippets.

@masfernandez
Last active March 25, 2024 12:25
Show Gist options
  • Save masfernandez/1d9130306df464fe1897df1728291704 to your computer and use it in GitHub Desktop.
Save masfernandez/1d9130306df464fe1897df1728291704 to your computer and use it in GitHub Desktop.
cat file without comments

Cat files without comments! only relevant information from config files will be shown

  • PHP ini files (linnes commented with ;):
cat php.ini | egrep -v "^\s*(;|$)"
  • Apache, Nginx conf files (lines commented with #):
cat php.ini | egrep -v "^\s*(#|$)"
  • Can be also group and aliased in .bashrc or .zshrc
alias g='egrep -v "^\s*(#|$|;|; )"'

for using shortcut like:

cat php.ini | g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment