Skip to content

Instantly share code, notes, and snippets.

@maurerle
Forked from masfernandez/cat_examples.md
Created March 15, 2024 15:02
Show Gist options
  • Save maurerle/e2563573dddf6f875a510a33dcba4a72 to your computer and use it in GitHub Desktop.
Save maurerle/e2563573dddf6f875a510a33dcba4a72 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