0

I want to find user, size, modified date and full file path of all files in sub-directories starting from a dir. I have got to following so far:

nohup sudo \
tree /work/mydir \
-sufiD \
--noreport \
--timefmt="%Y-%m-%d" | \
sed -e 's/ \+/ /g' -e 's/\[//g' -e 's/\]//g' -e 's/\.\///g' -e 's/ /|/g' | \
tail -n+2 \
> usage_mydir.txt &

This gives me the desired output except that it lists all files; i want to filter out files say less than 10MB which will reduce my output file considerably (from over 500 MB to less than 5MB).

I am open to any other commands such as find . -type f -size +10M. But I need the owner, size and last modified time of the file.

  • @Theophrastus, post that as an answer? – ilkkachu Jul 16 '20 at 16:21
  • 5
    Does this answer your question? [Files greater than 1 GB and older than 6 months](https://unix.stackexchange.com/questions/203129/files-greater-than-1-gb-and-older-than-6-months) – Cbhihe Jul 17 '20 at 06:31
  • 10 first hits on a Google search yields dupes and cross-dupes with accepted answers on SO, Super-User, unix.stackexchange and others. – Cbhihe Jul 17 '20 at 06:34
  • @Cbhihe This is obviously not a duplicate of the question you linked as different output is required. – Hauke Laging Jul 22 '20 at 01:44

1 Answers1

1

You can use -ls in find to get the owner size, and modification time:

find . -type f -size +10M -ls

L. Scott Johnson
  • 1,462
  • 1
  • 7
  • 16