Skip to content

Instantly share code, notes, and snippets.

@espinz
Last active November 2, 2019 11:11
Show Gist options
  • Save espinz/8d0bb9197d45dfecfb171e6c5de673fb to your computer and use it in GitHub Desktop.
Save espinz/8d0bb9197d45dfecfb171e6c5de673fb to your computer and use it in GitHub Desktop.
BSD find recipes

Find

Recipes for the find command

Exclude directories

find . -type d ( -path ./directory1 -o -path ./directory2 ) -prune -o -iname "*.txt" -print -exec mv {} TXT ;

Delete all files in a git directory

find . -maxdepth 1 ! -name ".git" -exec rm -rf {} ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment