Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Created August 2, 2012 17:12
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ttscoff/3238816 to your computer and use it in GitHub Desktop.
Save ttscoff/3238816 to your computer and use it in GitHub Desktop.
Bash alias to recursively delete Dropbox conflicted files
alias rmdbc="find . -name *\ \(*conflicted* -exec rm {} \;" # recursively delete Dropbox conflicted files
# and/or (smart idea from Gordon Fontenot)
alias rmdbcsafe="find . -name *\ \(*conflicted* -exec mv {} ~/DropboxConflicts/ \;" # recursively move Dropbox conflicted files to temp folder
# or... via TJ Luoma
alias rmdbctrash="find . -name *\ \(*conflicted* -exec mv -v {} ~/.Trash/ \;" # recursively move Dropbox conflicted files to Trash
# More advanced idea combining ideas from @modernscientist and @GFontenot would be
# Hazel or launchd script to move conflicted files to temp folder once a day, and Hazel or launchd script to delete files older than [x]
# Or schedule TJ's idea of moving to Trash and skipping intermediate folder while still maintaining the ability to review
# hmmmm...
@tjluoma
Copy link

tjluoma commented Aug 2, 2012

I do something similar, but I look for a more specific filename, and move to the Trash folder

find . -name \*\'s\ conflicted\ copy\ \* -exec mv -v {} ~/.Trash/ \;

@ttscoff
Copy link
Author

ttscoff commented Aug 2, 2012

Nothing short of brilliant. Wouldn't expect anything less from @tjluoma.

@tjluoma
Copy link

tjluoma commented Aug 2, 2012

If you want to see something really overdone, here's a shell script that I run when I need to compare conflicted copies against one another:

https://github.com/tjluoma/dropdups

(It's a zsh shell script, so I don't claim it is pretty, but it does work, at least for me :-)

@omarlakkis
Copy link

Well done. Smart use of horrendous ( characters in filenames!

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