How many files

Matsaki

Registered
How van I in a easy way find out how many image files a directory with many sub directories contains?
 
If the directories do not matter, type in Terminal.app

(first "cd" to the directory containing the pictures)

Code:
find . -type f -print|wc -l

If not all files are pictures, try something like

Code:
find . -type f -name '*.jpg' -print|wc -l

If your pictures are RAW format, use .cr2 or whatever your camera uses.
 
Last edited:
So I can just wright:

Code:
tar czvf archive.tar.gz --exclude=images

To exclude the images folder? (want to be sure not to make any bad mistakes)
 
No, because "--exclude" only works with files, not directories... but you can do something clever like exclude all files within that directory like so:

Code:
tar czvf archive.tar.gz --exclude='images/*'
 
Thanks El.

Because I have 33.000 images in the /images directory so to save time it would be good to exclude that directory.

I will cd in to the directory that I will compress and then run your last code.
 
Back
Top