LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-06-2007, 01:59 AM   #1
nadavvin
Member
 
Registered: May 2006
Distribution: ubuntu
Posts: 109

Rep: Reputation: 21
How do I know what is the size of directory with its contents.


With ls -l I can see only 4096 the size of any directory.

How do I know what is the size of directory with its contents?
 
Old 02-06-2007, 02:13 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Try the "du" command.
Useful options:
-h for more easily readable sizes or -k for sizes in kilobytes rather than multiples of blocksize
-c for totals
-s if you only want sizes of specific items (ie one specific directory, without looking at the sizes of all files/subdirectories it contains)

For more details, see "man du".
 
Old 02-06-2007, 03:26 AM   #3
nadavvin
Member
 
Registered: May 2006
Distribution: ubuntu
Posts: 109

Original Poster
Rep: Reputation: 21
thanks:

du -shc
 
Old 02-06-2007, 11:11 PM   #4
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Alternatively
Code:
du --max-depth=1
which gives you the size of all the subdirectories of the directory you are in
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using mv to move the contents of one directory into another apachedude Linux - Software 13 01-16-2009 08:57 AM
list contents of directory without listing contents baddah Linux - Newbie 2 06-12-2006 04:02 AM
Directory contents in / wordlife Linux - General 2 12-11-2005 02:30 AM
mv the contents of one directory to the parent directory warkrime Linux - Newbie 4 07-14-2003 07:03 PM
Get directory contents vank Programming 6 10-19-2002 10:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration