LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-03-2005, 11:24 AM   #1
Ataraxos
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Rep: Reputation: 0
Command folder size


I am searching a command which shows a folder size.
Thanx
 
Old 04-03-2005, 11:30 AM   #2
brainiac
Member
 
Registered: Jan 2005
Location: middle of a cornfield, IL
Distribution: Kanotix HD Install, Debian Testing, XP Pro,Vista RC1
Posts: 145

Rep: Reputation: 15
ls -l will show size and attributes.
 
Old 04-03-2005, 11:35 AM   #3
Ataraxos
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by brainiac
ls -l will show size and attributes.
ls -l
total 8
drwxr-xr-x 2 cmfans ftponly 4096 Aug 9 2004 botdir/
drwxr-xr-x 9 cmfans ftponly 4096 Apr 3 13:14 www/

where tells me the folder size?
 
Old 04-03-2005, 11:38 AM   #4
Greyweather
Member
 
Registered: Aug 2003
Distribution: Ubuntu 4.10
Posts: 311

Rep: Reputation: 30
ls -s

If you want it to show the size in megabytes when the files are that big use:
ls -sh

Last edited by Greyweather; 04-03-2005 at 11:43 AM.
 
Old 04-03-2005, 11:42 AM   #5
Ataraxos
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Greyweather
ls -s

If you want it to show the size in megabytes when the files are that big use:
ls -sh
ls -s --block-size=M
total 1M
1M botdir/ 1M www/

 
Old 04-03-2005, 11:44 AM   #6
Greyweather
Member
 
Registered: Aug 2003
Distribution: Ubuntu 4.10
Posts: 311

Rep: Reputation: 30
So in your case, use

ls -sh botdir/
ls -sh www/

The first thing it'll output is the total size of the directory ("folder" in Linux-speak), then the size of each file.

Last edited by Greyweather; 04-03-2005 at 11:47 AM.
 
Old 04-03-2005, 11:47 AM   #7
Ataraxos
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Greyweather
So in your case, use

ls -sh botdir/
ls -sh www/
It returns me

ls -sh www/
total 34M
... (and the size of each file)

34MB is the size of files inside www but don't calculate the size of subfolders which are inside in www.

Any ideas?
 
Old 04-03-2005, 12:03 PM   #8
Greyweather
Member
 
Registered: Aug 2003
Distribution: Ubuntu 4.10
Posts: 311

Rep: Reputation: 30
du -sh botdir/
du -sh www/

This is what I should have told you to use from the start, but I just found out about it. ^_^;;

Last edited by Greyweather; 04-03-2005 at 12:05 PM.
 
Old 04-03-2005, 12:09 PM   #9
Ataraxos
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Thanx dude worked!!!

 
  


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
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM
How to check the size of a folder from command prompt skoivisto Linux - General 2 07-31-2004 02:41 PM
Folder size xedios Linux - Software 1 07-05-2004 04:40 AM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 02:26 AM
Folder size imsajjadali Red Hat 3 01-30-2004 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:25 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