Filter out small files

Started by lumiere, December 26, 2021, 05:55:36 PM

Previous topic - Next topic

lumiere

On my disks I have a lot of family and non-family pictures (thumbnails, caches etc). I know for sure that family pictures are much bigger.
Is there any way to tell exiftool to deal only with files bigger than X ?

StarGeek

Use something like
-if "$filesize# >4000000"
where the number is number of bytes.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Depending on what you are doing, you may be able to speed up processing significantly by using -if5 instead of -if.  Read the application documentation for details.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lumiere

I looked at:
https://exiftool.org/
https://exiftool.org/exiftool_pod.html
https://exiftool.org/faq.html
but none of those mentioned $filesize option.
Which specific page will tell me about "if" and "filesize" ?

StarGeek

-if option

Extra Tags page

Also, the hashtag at the end of Filesize is a shortcut for the -n (--printConv) option which will give you the size in bytes rather than converting it to K/M/G/TBytes.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype