Exforsys

Free Training

Shell Program to count files directories

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 ...

Go Back   Exforsys > Articles and Tutorials > Shell Scripting Tutorials

Exforsys.com


Shell Scripting Tutorials Shell Scripting Tutorials Discussions

Reply

 

LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 06-30-2005, 10:08 AM
Junior Member
 
Join Date: Jun 2005
Posts: 4
jennifer99 is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-01-2005, 03:56 PM
Junior Member
 
Join Date: Jul 2005
Location: Chandigarh
Posts: 1
gkpruthi is on a distinguished road
Send a message via MSN to gkpruthi Send a message via Yahoo to gkpruthi
ls -l |wc -l
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-05-2005, 03:46 AM
Junior Member
 
Join Date: Jun 2005
Posts: 4
jennifer99 is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-20-2005, 05:31 AM
Junior Member
 
Join Date: Sep 2005
Posts: 1
david is on a distinguished road
find / -name "*" -type f | wc -l
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-25-2007, 06:08 AM
Junior Member
 
Join Date: Jun 2007
Posts: 8
psiva_exforsys is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:55 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.