Aug 13, 2001 #1 cadbilbao Programmer Apr 9, 2001 233 ES Hi! I do not remember the way to count the number of files and subfolders stored into the same directory. Could anybody help me?
Hi! I do not remember the way to count the number of files and subfolders stored into the same directory. Could anybody help me?
Aug 13, 2001 #2 greenpau MIS Mar 28, 2001 32 US You can always do "ls -l |wc -l" This will give you a long list of the dir, and then count the lines. Cheers Upvote 0 Downvote
You can always do "ls -l |wc -l" This will give you a long list of the dir, and then count the lines. Cheers
Aug 13, 2001 #3 ayjaycee Technical User Mar 5, 2001 291 GB I'd use find :- cd directory find . -print | wc -l If you just want to count files (not directories), then find . -type f -print | wc -l For Directories only, If you just want to count files (not directories), then find . -type d -print | wc -l HTH TandA http://www.tanda.f2s.com Upvote 0 Downvote
I'd use find :- cd directory find . -print | wc -l If you just want to count files (not directories), then find . -type f -print | wc -l For Directories only, If you just want to count files (not directories), then find . -type d -print | wc -l HTH TandA http://www.tanda.f2s.com