Home » Questions » Computers [ Ask a new question ]

How to find and then compare similar files in Dropbox folder?

How to find and then compare similar files in Dropbox folder?

"I am using Dropbox, and I wind up with a number of files like:
prefs (home's conflicted copy 2009-07-20).js"

Asked by: Guest | Views: 55
Total answers/comments: 1
Guest [Entry]

"I figured out something that seems to works, but I would welcome suggestions to improve it, including making it cleaner:

find . -name ""*onflict*"" | while read name; do ls -ld ""$name""; ls -ld ""${name/ (*onflict*)/}""; echo -n ""$name"" | xargs -0 -p rm ; echo ; done

In a more easily read and typed format:

find . -name ""*onflict*"" | \
while read name; do
ls -ld ""$name""
ls -ld ""${name/ (*onflict*)/}""
echo -n ""$name"" | xargs -0 -p rm
echo
done

References:

Using the shell to ""mill"" over the results of the initial find command- a pipemill
http://en.wikipediadotorg/wiki/Pipeline_(Unix)#Pipemill
Manipulating strings in the shell
http://www.linuxjournal.com/article/8919
http://tldpdotorg/LDP/abs/html/string-manipulation.html#SUBSTRREPL00
Using xargs
http://en.wikipediadotorg/wiki/Xargs
http://ss64.com/bash/xargs.html"