Home » Questions » Computers [ Ask a new question ]

Why might -exec affect the output of find in Linux?

Why might -exec affect the output of find in Linux?

If I run this command...

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

"You've got to group your expression correctly - currently the -exec only applies to the last -or branch.

sudo find /storage \( -name ""*~"" -or -name "".*~"" -or -name ""#.*#"" -or -name "".DS_Store"" -or -name ""Thumbs.db"" \) -exec rm -v {} \;

Just remember that -exec is just an expression that returns true if the command returns zero, so running the command is just a side-effect."