Aside from the fact that / isn't exactly a user directory, that -exec is missing the trailing semicolon, and you have to escape those curlies on popular shells like bash. And -exec will run a subshell and the program for *every* file. That gets slooooow.
This may be all you need:
Code:
find ~ -size +5M -ls
That will list out all 5 megabyte files under your home directory. But if you want the information that the actual ls command provides (or stat), I 'd recommend piping find to xargs. This is a great technique:
Code:
find ~ -size +5M -print | xargs ls -l
To explain: the -print option prints out each path found on a separate line. xargs will then grab a batch of lines and pass them to the program listed as arguments. So you're executing your program 1/1000th as many times as if you had used -exec.
It is possible that a path can contain the newline character. While this is very rare in practice, if you're concerned, you can do this instead:
Code:
find ~ -size +5M -print0 | xargs -0 stat -x
Now rather than separating each path with a newline character, a null is used, and xargs will split on nulls. Aside from that, it works exactly the same. This is the preferred way because it's bulletproof.