The UNIX and Linux Forums  

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
Increasing screen display size sellafrica1 AIX 0 05-08-2008 11:09 AM
display filesystem size that cross 75% as used HAA Shell Programming and Scripting 2 04-24-2007 05:56 AM
Display size shaan_dmp UNIX for Dummies Questions & Answers 1 02-13-2007 09:16 AM
Display Directory Size - DF? t4st33@mac.com UNIX for Dummies Questions & Answers 3 01-11-2007 02:12 AM
What's the easiest way to display system cpu, memory, # drives/size ?? eyounes UNIX for Advanced & Expert Users 4 03-12-2002 08:31 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-23-2008
chebarbudo's Avatar
chebarbudo chebarbudo is offline
Registered User
  
 

Join Date: Nov 2008
Location: various
Posts: 188
Display directory size

Hi all,

Is there any built in function that can display the content of a directory showing the size of directories?
I want to see the content of a directory without recursion. I don't want to see the content of all subdirectories.
I want to see the contained files with their size and the contained directories with their total size (including everything they contain).

1) I cannot get ls to do that.
2) With du, I can only get either the total size of one directory or the total size of all subdirectories (even several levels under).

Thanks in advance
Santiago

Here is an example of a directory tree with what I get with ls, then what I get with du and finally what I'd like to get:

Code:
~$ ls -lR
.:
-rw-r--r-- 1 santiago santiago   88 2008-11-23 10:34 file
drwxr-xr-x 4 santiago santiago 4096 2008-11-23 10:34 folderA
drwxr-xr-x 2 santiago santiago 4096 2008-11-23 10:35 folderB

./folderA:
-rw-r--r-- 1 santiago santiago   31 2008-11-23 10:34 fileA
drwxr-xr-x 2 santiago santiago 4096 2008-11-23 10:34 folderC
drwxr-xr-x 2 santiago santiago 4096 2008-11-23 10:34 folderD

./folderA/folderC:
-rw-r--r-- 1 santiago santiago  269 2008-11-23 10:34 fileC

./folderA/folderD:
-rw-r--r-- 1 santiago santiago  509 2008-11-23 10:34 fileD

./folderB:
-rw-r--r-- 1 santiago santiago  623 2008-11-23 10:35 fileB

~$ du
623    ./folderB
269    ./folderA/folderC
509    ./folderA/folderD
809    ./folderA
1520   .

~$ whatidlike
file       88
folderA   809
folderB   623

 

Bookmarks

Tags
directory, size

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 09:19 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