The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
row count of all files with more than 0 byte sri2005 UNIX for Dummies Questions & Answers 6 04-29-2008 06:39 PM
Display the count of files wayne1411 Shell Programming and Scripting 4 01-09-2008 10:09 PM
Provide a count of files keymind UNIX for Dummies Questions & Answers 5 12-30-2007 01:57 PM
awk command to find the count of files ina directory sish78 Shell Programming and Scripting 11 07-19-2007 09:00 AM
count of files mahalakshmi Shell Programming and Scripting 13 11-28-2006 09:01 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-14-2006
balireddy_77 balireddy_77 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 31
Post command to count files in dir

hi
plz let me know the command to count the files in directory.
thanks in advance
-Bali Reddy
  #2 (permalink)  
Old 11-14-2006
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
ls -1 | wc -l

This will give you a count of all the files (including directories). If you want just certain files, either change the ls command to look for *.txt (to look for files with .txt extension), or use the find command to look for certain types of files (see the man page for find, look for the -type option).
  #3 (permalink)  
Old 11-14-2006
computersaysno computersaysno is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 5
Can you use this command to count all of the files over a certain size?
  #4 (permalink)  
Old 11-14-2006
kamitsin's Avatar
kamitsin kamitsin is offline
Registered User
  
 

Join Date: Nov 2006
Location: /dev/null
Posts: 177
Quote:
Can you use this command to count all of the files over a certain size?
Use find. Look at man find for more options.


Code:
find /usr/bin/ -size 11k -exec ls {} \;|wc -l

  #5 (permalink)  
Old 11-15-2006
aju_kup aju_kup is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 189
use

ls -l |grep ^\- | wc -l
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 07:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0