Polly wanna cracker

Regex and Grep cheat sheet

Cheat sheet based off the Udemy cysa+ course from Jason Dion – video 75 as i’m sure i’ll end up looking for it at some point in the future.

REGEX:

[] – Match a single instance of a chracter from a range such as a-z A-Z 0-9 or for all [a-zA-Z0-9]

[\s] – Match whitespace

[\d] – Match a digit

+ – Match one or more occurrences e.g. \d+-

*- Match zero or more occurrences e.g. \d*

? – Match one or none occureences e.g. \d?

{} – Match the number of times within the braces e.g. \d{3} finds 3 digits in a row or \d{7-10} matches 7,8,9 or 10 digits in a row

| – OR

^ – Only search at the start of a line

$ – Only search at the end of a line

GREP:

-F = search for a literal value, can use “” instead of -F

-r = recursive

-i = Ignore case sensitivity

-v = Find things which do not match

-w = Treat search strings as words (instead of parts of words)

-c = Show count of matches

-l = Return names of files containing matches

-L = Return names of files without matches

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

<span>%d</span> bloggers like this: