LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 10-23-2004, 04:23 PM   #1
GryphonTech
LQ Newbie
 
Registered: Sep 2003
Posts: 10

Rep: Reputation: 0
How does one calculate folder sizes in linux


What command(s) do I need to run in order to see calculated folder sizes in linux. My OSX box does this through the GUI. I have a linux server running that I am learning on and I'd like to beable to calculate the folder sizes.

I can run ls -lR and that shows me recursively the contents of a dir but I just need to know the calculated sizes.

Example.

MainDir
DirA
ContentA
ContentB

DirB
ContentAA
file1
file2
file3
ContentBB
file1
DirBB
file1
file2
ContentCC

DirC
ContentAAA

DirD
file1
file2


What I need to get is

MainDir
DirA 5Gig
DirB 500M
DirC 1Gig
DirD 200M


I'm planning on piping the output to a text file for later use. Any suggestions would be great.

Many thanks.
 
Old 10-23-2004, 04:32 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
In the directory that holds the other directories
du -sm *


Cheers,
Tink
 
Old 10-23-2004, 04:50 PM   #3
GryphonTech
LQ Newbie
 
Registered: Sep 2003
Posts: 10

Original Poster
Rep: Reputation: 0
Many thanks.....

Niiiiice. So simple I am kicking myself for not figuring it out.

Thanks so much!

Rob
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to calculate bandwidth on linux epsharma Linux - Software 4 07-02-2006 11:45 AM
Linux Partition Sizes ryN Linux - Software 9 11-12-2004 06:00 AM
Linux will not calculate my free space correctly on fat32 drive The_Last_Nerd Linux - Hardware 12 06-23-2004 04:42 PM
how to calculate shmmax when install Oracle in Linux exper Linux - Software 1 02-17-2004 06:15 AM
Calculate the space of a folder Half_Elf Linux - General 4 05-18-2003 08:53 PM


All times are GMT -5. The time now is 06:15 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration