I need to get details on file size in the following find command. I must be putting the -size option in the wrong place or else I should not be using that to get the file size's.

find CDR* -type f -newermt 10/15/2018 | head -n100 >filelist100.txt

closed as unclear what you're asking by Kusalananda, Jeff Schaller, user88036, Shadur, schily Oct 17 '18 at 12:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    there's no -size in the command you listed (yet)... – Jeff Schaller Oct 16 '18 at 16:37
  • 1
    So you want to find files starting with CDR, or somewhere inside any directory starting with CDR, that were modified after yesterday. Of these files you want only the first 100. -- Or do you want the 100 largest of the files? – Hagen von Eitzen Oct 16 '18 at 16:44
  • RTFM - Read the find(1) man page > If the expression contains no actions other than -prune, -print is performed on all files for which the expression is true. It's providing you only the file name, as implied/requested. If you want info on file size, you can either use the -size option with your expressions, or you can -exec something like -ls -l and output to a file, then sort those results – 0xSheepdog Oct 16 '18 at 18:52
  • Your stated command demonstrates a severely flawed understanding of how find works. Please explain what exactly you're trying to accomplish, because what you're actually doing is so badly wrong it's impossible for us to tell what you expected to happen. – Shadur Oct 17 '18 at 6:45
find CDR* -type f -newermt 10/15/2018 -exec du -sh {} \; | 
head -n100 >filelist100.txt

Here is the find your find command with an execution of a du -sh command on the output.

You can of course change the -exec command to match the exact output that you need.

Not the answer you're looking for? Browse other questions tagged or ask your own question.