stevenriz
IS-IT--Management
- May 21, 2001
- 1,069
Hi all, I would like to list the number of files in a subdirectory and have built a couple of commands, can any of you show me what if anything I am doing wrong?
I initially ran this command....
ls -R . | wc -l #which seemed to count semi accurately
So I built a test of a directory with 10 subdirectories, no files. ls -R . | wc -l resulted in a count of 34. with 10 subdirectories I manually counted 23 after running ls -R
When running ls -Ra. | wc -l I got a result of 70 and again when running it manually I counted 48... I don't understand...
I am looking for an accurate file count here... Thanks!!!
I initially ran this command....
ls -R . | wc -l #which seemed to count semi accurately
So I built a test of a directory with 10 subdirectories, no files. ls -R . | wc -l resulted in a count of 34. with 10 subdirectories I manually counted 23 after running ls -R
When running ls -Ra. | wc -l I got a result of 70 and again when running it manually I counted 48... I don't understand...
I am looking for an accurate file count here... Thanks!!!