Skip to content

Instantly share code, notes, and snippets.

@a10y
Created August 5, 2011 06:02
Show Gist options
  • Save a10y/1126995 to your computer and use it in GitHub Desktop.
Save a10y/1126995 to your computer and use it in GitHub Desktop.
find
## Find move all mp4 movies in a directory to an external drive/folder, than delete all large files
LARGE_FILE_SIZE=500 ##in MB
START_DIR=$HOME
EXTERN_DIR=/Volumes/Extern/movies
find $START_DIR -type f -name "*.mp4" -exec mv {} $EXTERN_DIR ';'
find $START_DIR -type f -size +${LARGE_FILE_SIZE}M -exec rm {} ';'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment