Skip to content

Instantly share code, notes, and snippets.

@Rafe
Created April 15, 2012 02:40
Show Gist options
  • Save Rafe/2389552 to your computer and use it in GitHub Desktop.
Save Rafe/2389552 to your computer and use it in GitHub Desktop.
Grep cheatsheet
grep [PATTERN] [FILE]
grep apple fruitlist.txt
grep apple *.txt
grep ^app fruitlist.txt
"-x :: exact line
grep -x apple fruitlist.txt
"-v :: without
"-n :: line num
"pipeline : for line without username and password::
grep -v username list.txt | grep -v password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment