-size n[ckMGTP]
True if the file's size, rounded up, in 512-byte blocks is n. If
n is followed by a c, then the primary is true if the file's size
is n bytes (characters). Similarly if n is followed by a scale
indicator then the file's size is compared to n scaled as:
k kilobytes (1024 bytes)
M megabytes (1024 kilobytes)
G gigabytes (1024 megabytes)
T terabytes (1024 gigabytes)
P petabytes (1024 terabytes)
Yes, I had done my due diligence and concluded that -size is not the desired function. Web searching only produced results for Linux, where -size accepts operators, including greater-than.-size
might not do what you want, as it'll be looking for an exact size, not larger than.
You can use something like
Code:find /usr/home -type f | xargs stat -f '%N %z' | awk '{ if ($2 > 10000000) { print $1;}}'
$ find /usr/home -type f | xargs stat -f '%N %z' | awk '{ if ($2 > 10000000) { print $1;}}'
find: /usr/home/user1/.ssh: Permission denied
xargs: unterminated quote
Aha, just the job, thank you vee much.find /usr/home -type f -size +10M
zpaqfranz dir /usr/home /s -minsize 10000000
Probably the wrong kind of quote problem.Seems to be a problem in the xargs bit.
Seems to be a problem in the xargs bit.
Probably the wrong kind of quote problem.
$
prompt). One user cannot read the ~/.ssh directory (and some of the files under it, like your private keys) of another user. Hence the "permission denied". That 'error' then propagated to xargs(1) which also produces an error message based on the erroneous input it received from the find(1) command.stderr
, not stdout
, so won't impact xargs
(reading from its stdin
). Trymkdir foo; chmod 0 foo
find . -type f | xargs stat -f '%N %z' | awk '{ if ($2 > 10000000) { print $1;}}'
touch a\'b
find . -type f | xargs stat -f '%N %z' | awk '{ if ($2 > 10000000) { print $1;}}'