Skip to content

Instantly share code, notes, and snippets.

@sfdcale
Last active April 23, 2020 22:50
Show Gist options
  • Select an option

  • Save sfdcale/ed3c119f6dc118afaa69bc8b15229c49 to your computer and use it in GitHub Desktop.

Select an option

Save sfdcale/ed3c119f6dc118afaa69bc8b15229c49 to your computer and use it in GitHub Desktop.
Store this command in ~/.zshrc to delete files
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