The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Provide a count of files keymind UNIX for Dummies Questions & Answers 5 12-30-2007 01:57 PM
problem with 0 byte and large files dsravan Shell Programming and Scripting 3 04-20-2007 09:59 PM
byte count and cut command hemangjani Shell Programming and Scripting 4 04-12-2007 11:32 AM
count of files mahalakshmi Shell Programming and Scripting 13 11-28-2006 09:01 AM
shell script to find zero byte files ramky79 Filesystems, Disks and Memory 2 09-15-2006 12:12 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-29-2008
sri2005 sri2005 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 4
row count of all files with more than 0 byte

Hi,

Is there any way to get count number of lines in all files which have more than o bytes in current directory


for example :

in /user/sri/ there are 3 files

abc 0 bytes
def 5 bytes
ghi 10 bytes

i need to get wc -l for all files which have > 0 bytes at a time ..is it possible?
  #2 (permalink)  
Old 04-29-2008
amitg amitg is offline
Registered User
  
 

Join Date: Apr 2008
Location: New York, NY
Posts: 8
Sri
Since you want to count the number of lines, how does it matter if a file has 0 bytes? You could simply do "cat * | wc -l" to get the line count.

Amit
  #3 (permalink)  
Old 04-29-2008
sri2005 sri2005 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 4
amit,

My question i how to get all the counts for all files at a time in current directory..If i have 100 files which have greater than 0 byte i need to get count of all files at a time...in that particular directory
  #4 (permalink)  
Old 04-29-2008
amitg amitg is offline
Registered User
  
 

Join Date: Apr 2008
Location: New York, NY
Posts: 8
Not sure I understand, can you provide an example of the desired output?
  #5 (permalink)  
Old 04-29-2008
rubin's Avatar
rubin rubin is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2007
Posts: 321
Code:
find /dir -size +0 -type f | wc -l
man find.

Last edited by rubin; 04-29-2008 at 11:12 AM.. Reason: added type f
  #6 (permalink)  
Old 04-29-2008
sri2005 sri2005 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 4
Rubin,

Thanks for command..But this command displaying number of files in current directory with more than 0 bytes...but i also need number of lines in each individual file which have more than 0 bytes...lets suppose your command gives me 34 files which have more than 0 bytes in current directory..i need in each of 34 files how many lines are there like file a contains 10 lines file b contains 30 lines...like that....Is it possible? let me know...if you are still unclear?
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 04:41 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