Last active
December 30, 2015 01:59
-
-
Save JCotton1123/7759674 to your computer and use it in GitHub Desktop.
Linux CLI snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## All IPs | |
egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | |
## Find a distinct list of file exts within a specified directory | |
find ./ -type f -name "*.*" -exec basename {} \; | rev | cut -d. -f 1 | sort | uniq | rev | |
## Find files with the supplied exts (linux) | |
find ./ -regextype posix-extended -regex ".*(mp3|mp4|pdf|PDF|doc|zip|ZIP|wav|gz)$" | |
## Find files with supplied exts (mac) | |
find -E ./ -regex ".*(tar|wav|wav|wmv|wmv|xls|zip)$" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment