
- Forum
- Operating Systems
- Shell Programming
- Shell Program to count files directories
Shell Program to count files directories
This is a discussion on Shell Program to count files directories within the Shell Programming forums, part of the Operating Systems category; Hi , Can any body suggest me how to write a shell program to for displaying directory and file count ...
-
06-30-2005, 10:08 AM #1
- Join Date
- Jun 2005
- Answers
- 3
Shell Program to count files directories
Hi ,
Can any body suggest me how to write a shell program to for displaying directory and file count in the current directory.
Thnx& Regards
-
07-01-2005, 03:56 PM #2
- Join Date
- Jul 2005
- Location
- Chandigarh
- Answers
- 1
ls -l |wc -l
-
07-05-2005, 03:46 AM #3
- Join Date
- Jun 2005
- Answers
- 3
Sorry You mistook me
Hi pruthi,
I am not trying to print the no of files and directories together . But I need their count seperately.
Example :
If I have 10 ordinary files , 5 special files , 3 direcories etc. I should get their count seperately. I did this earlier but forgat the logic
Any way thanks for the reply.
Thnx & regards
-
find / -name "*" -type f | wc -l
-
06-25-2007, 06:08 AM #5
- Join Date
- Jun 2007
- Answers
- 8
How to count files directorys
The below command used to count the fikes and directorys
ls -rtl | wc -r | grep "^-r" --> for count the files.
ls -rtl | wc -c | grep "^-d" --> for count the directorys.
Regards,
Siva.P
Last edited by psiva_exforsys; 06-25-2007 at 06:10 AM.
-
Sponsored Ads

Reply With Quote





