You'll want to use something like:
while read directory
do
find "$directory" -size +1M -exec stat --format="%U (id: %u), file: %n" {} \;
done << EOT
/path/to/folder 1
/path/to/my folder 2
EOT
The +1M
would look for files over 1M.
The stat format would show a username, its user ID and corresponding file name, for anything find would have matched.
Following up on comments, say I want to filter these on modification time, such as find
should not match any file that got modified in the last 24 hours, then I could use:
find "$directory" -size +1M -mtime +1 -exec stat --format="%U (id: %u), file: %n" {} \;
/path/to/watch
to/aaa/bbb/cccc/dddd
, although I'ld probably have missed your point: what do you mean, what "following" directory? – SYN Jan 09 '18 at 12:09/aaaa/bbbb/cccc/dddd
has a meaning, and it is not "folderaaaa
or folderbbbb
or foldercccc
". – SYN Jan 09 '18 at 12:56/home/p4/patent/sharing': No such file or directory find:
folder/': No such file or directory – Rajadurai Jan 10 '18 at 11:27"/home/p4/patent/sharing folder"
instead. – SYN Jan 10 '18 at 12:32find
) – SYN Jan 10 '18 at 12:41-mtime
, matching files based on modification time. – SYN Jan 17 '18 at 08:50mtime
would expect for an argument. I have no idea what you mean by "old age", you'ld want to figure that one out. Right here and now, what you need isman find
. If your question changed, then edit your initial post. At which point it would make sense for me to update my answer. – SYN Jan 17 '18 at 08:58