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 01-09-2007, 07:58 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Directory Size


Is in possible in Linux to view a directory size combined with the folders contents? I can right click a folder on my Desktop and see it's 9+MB's combined with it's contents but when I ls -h the folder, it's always 4kb.

Is it not possible to ls the directory and see how big the folder is?
 
Old 01-09-2007, 08:00 PM   #2
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Ah - I guess playing around in the terminal kind of answered my own question.

Code:
carlos@cwilliams:~/Desktop$ ls -lh
total 25M
drwxr-xr-x 2 carlos carlos 4.0K 2007-01-09 20:13 file
-rwx------ 1 carlos carlos  340 2007-01-02 18:25 Firefox.desktop
-rw------- 1 carlos carlos  25M 2006-01-17 11:48 M4V00003.MP4
carlos@cwilliams:~/Desktop$ du -h file/
9.5M    file/
 
Old 01-09-2007, 08:05 PM   #3
xjlittle
Member
 
Registered: Aug 2003
Location: Indiana
Distribution: fc6 sles9 & 10 kubuntu ubuntu-server
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
You could also use
Code:
du -h
 
Old 01-09-2007, 08:06 PM   #4
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by xjlittle
You could also use
Code:
du -h
Um, yeah. That is the command I issued above your post...
 
  


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
directory size? maggus Linux - Newbie 4 12-03-2006 04:45 PM
How to know the size of a directory? kornerr Linux - General 4 06-30-2005 09:59 AM
getting the directory size in c rajesh_b Programming 7 01-06-2005 06:41 AM
directory size adenardo Linux - General 1 10-23-2001 01:34 PM
Directory Size Helixx Linux - General 1 04-27-2001 08:49 PM

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

All times are GMT -5. The time now is 08:58 AM.

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