Last active
April 23, 2020 22:50
-
-
Save sfdcale/ed3c119f6dc118afaa69bc8b15229c49 to your computer and use it in GitHub Desktop.
Store this command in ~/.zshrc to delete files
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
| cleanUpDirectory(){ | |
| if [ $# -lt 1 ]; then | |
| echo 1>&2 "$0: not enough arguments" | |
| return | |
| fi | |
| find -E $1 -type f -maxdepth 1 -regex '.*\.(jpg|png|csv|txt|jpeg|dmg|pdf)' -exec rm -i {} \; | |
| } | |
| find / -type f -name '*.py' 2>/dev/null -exec grep --color --extended-regexp --with-filename --regexp 'access_token,' {} \; | |
| find ../ -type f -regex '.*.js' -not -regex '.*node\_modules.*' -exec grep -EHni --color "\*\*\*" {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment