This is a discussion on Shell Program to count files directories within the Shell Scripting Tutorials forums, part of the Articles and Tutorials category; Hi , Can any body suggest me how to write a shell program to for displaying directory and file count in ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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. |