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
Command should return the each folder size on disc sdurukkar AIX 1 09-27-2007 10:31 AM
Limit Folder Size tisdmin UNIX for Dummies Questions & Answers 2 01-17-2007 11:00 PM
finding duplicate files by size and finding pattern matching and its count jerome Sukumar Shell Programming and Scripting 2 12-01-2006 04:20 AM
Scripting to find the size of the folder victorvvk Shell Programming and Scripting 2 03-17-2005 06:14 AM
Linux/Solaris has any limit on folder size ? bache_gowda UNIX for Dummies Questions & Answers 1 06-28-2003 09:23 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 09-10-2008
TonySolarisAdmi TonySolarisAdmi is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 11
Need help in finding Folder Size

Hi,
I would like to find the size of a folder. When I run the command
du -k
It is going through all the sub-folder and files and taking really much time.

Is there any command to get the complete directory size without showing the sub-folder and file size.

Appreciate your response.


Thanks!
  #2 (permalink)  
Old 09-11-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
You could just add up the file sizes from ls -l?

Code:
ls -l | awk '{t+=$5}END{print t}'
  #3 (permalink)  
Old 09-11-2008
spirtle spirtle is offline
Registered User
  
 

Join Date: Jun 2008
Location: Scotland
Posts: 150
du (GNU at least) has a -s flag to do just that.
Otherwise see e.g. du a directory
  #4 (permalink)  
Old 09-11-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
spirtle, while -s is useful, it doesn't avoid it searching through the subdirectories and adding them to the value reported, which is what the OP was asking for.
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 08:57 PM.


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