I have a folder with over 200 sub-folders (no sub-sub-folders). Is there a way to get a list of all of the sub-folders and the number of files contained in each folder? Any help is appreciated.
Example:
Folder A - 25
Folder B - 1
Folder C - 345
etc
This is exactly what I needed. The terminal is fantastic. I don’t know what I’m doing there but I can copy and paste pretty good.
I wasn’t able to change the directory to /Pictures/mypix:
If I entered “cd /Pictures”, it would change the directory to “Pictures”
If I entered “cd /Pictures/mypix”, it would state it couldn’t find that directory
I ended up just moving “mypix” into my home folder and running your script in the terminal. Worked fine.
Thank you for your help. I appreciate it. Take care.
Sorry, this was wrong - to change to the Pictures directory in the Terminal I just entered cd Pictures (no slash). Never could get to the sub-folder mypix within Pictures, so I just moved it into the home folder.
Anyway, you solved my problem and saved me a lot of time. Thanks again.
Hey, just noticed my problem: mypix had a space at the end of the name, ie "mypix ". When I removed the space at the end of the name I was able to change the directory to mypix as a subfolder in Pictures. This kind of stuff drives me crazy.
In the terminal you can autocomplete file and folder names. If you type the first few letters of the file/directory (e.g. myp) and then press the tab key it will autocomplete the rest of the location/file you are navigating to. Very handy when you have a file with a very long name that you are trying to open.