Skip to content

Instantly share code, notes, and snippets.

@epynic
Last active February 9, 2019 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epynic/783a638293356194e8eb443607c5ea1d to your computer and use it in GitHub Desktop.
Save epynic/783a638293356194e8eb443607c5ea1d to your computer and use it in GitHub Desktop.
linux-grep examples
ls /usr/bin | grep zip # list all zip files
ls /usr/bin | grep -c zip # list all zip files count
ls /usr/bin | grep -v zip # list all !zip files = not containing the pattern
ls /usr/bin | grep -n zip # list all zip files - frints the line:file
grep -i linux file_name.txt #find in files ignore case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment