Usage Tips:
- Click on a keyword to enable inline editing.
- Click inside a code block to copy (excludes comments).
- Use the button to view examples.
- Click outside to collapse all examples.
Basic
grep '<STRING>' <FILE>
Sample Output:
TO-DO
Grep from files recursively (e.g from current directory)
grep -rni '<STRING>' .
Sample Output:
TO-DO
Grep from binary
grep -a '<STRING>' <FILE>
Sample Output:
TO-DO
Grep hash from binary with perl regex
grep -aPo '[a-fA-F0-9]{32}' <FILE>
Sample Output:
TO-DO
Grep from binaries recusively (e.g. from /var/log)
sudo grep -rHa "<STRING>" /var/log
Sample Output:
TO-DO
Find unique char of a file
cat <FILE> | od -cvA none -w1 | sort -bu | tr -d '\n' | tr -d ' '
Sample Output:
TO-DO