3
1
If I run this command...
sudo find /storage -name "*~" -or -name ".*~" -or -name "#.*#"
-or -name ".DS_Store" -or -name "Thumbs.db"
... it gives me a list of matching files, as expected. However, if I use this command...
sudo find /storage -name "*~" -or -name ".*~" -or -name "#.*#"
-or -name ".DS_Store" -or -name "Thumbs.db" -exec rm -v {} \;
... nothing is deleted. Similarly, with echo, nothing is printed...
sudo find /storage -name "*~" -or -name ".*~" -or -name "#.*#"
-or -name ".DS_Store" -or -name "Thumbs.db" -exec echo {} \;
How come?
@Douglas Leeder - Came across this example that helped me answer my own question at http://superuser.com/questions/474439/find-missing-argument-to-exec-when-executing-the-find-command-in-linux however I don't quite follow the statement
– PeanutsMonkey – 2012-09-15T07:33:25.747so running the command is just a side-effect
. What do you mean by that exactly?especially note the escaped parentheses
– quack quixote – 2010-01-12T22:16:31.737\(
and\)
-- this prevents the shell from interpreting them; in this case you wantfind
to handle them as part of the expression. this and other good examples on the find manpage: http://linux.about.com/od/commands/l/blcmdl1_find.htmSeems my workaround wasn't necessary, works like a charm, cheers. – Jeffrey Vandenborne – 2010-01-12T23:02:37.680