LinuxQuestions.org
Register a domain and help support LQ
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-26-2009, 01:35 AM   #1
sumeet inani
Member
 
Registered: Oct 2008
Posts: 898
Blog Entries: 26

Rep: Reputation: 49
how to find folder size using command


Hi,
I want to know is there a command to find size of a folder.
 
Old 10-26-2009, 01:38 AM   #2
Halpo
LQ Newbie
 
Registered: Oct 2009
Location: Lansing
Distribution: #!
Posts: 2

Rep: Reputation: 1
I think you are looking for the 'du' command.

running
Code:
du -h --max=0
will give you the size of a folder, and it's contents.
 
Old 10-27-2009, 03:57 AM   #3
sumeet inani
Member
 
Registered: Oct 2008
Posts: 898
Blog Entries: 26

Original Poster
Rep: Reputation: 49
ALTERNATIVE
i found out another way to find the size of current folder you are in:
du -h -s
h stands for human readable i.e appropriate conversion to KB,MB,GB instead of raw count.
s stands for summarise(just in case you are interested to know meaning of options).

Last edited by sumeet inani; 10-27-2009 at 08:48 AM.
 
Old 10-27-2009, 04:01 AM   #4
sumeet inani
Member
 
Registered: Oct 2008
Posts: 898
Blog Entries: 26

Original Poster
Rep: Reputation: 49
QUESTION)How to find size of all subfolders in current folder in 1 stroke?
To get size of all subfolders in current folder:
du * -s -h

Isn't it amazing.The more you think you the more you learn in linux.Terminal commands are impressive & self sufficient to do any task(I think).

Last edited by sumeet inani; 10-27-2009 at 08:48 AM.
 
Old 11-09-2009, 08:48 AM   #5
sumeet inani
Member
 
Registered: Oct 2008
Posts: 898
Blog Entries: 26

Original Poster
Rep: Reputation: 49
Solution for all

SOLUTION FOR ALL
question)How to find size of folder
ANSWER)To get size of current folder run 'du -sh' (without quotes)

question)How To get size of subfolders in current folder
ANSWER)du * -sh

If my compilation helps you then thank me by pressing thumbs up button .Thank You.

Last edited by sumeet inani; 11-12-2009 at 03:12 AM.
 
  


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 find a folder size? concoran Linux - Newbie 7 11-30-2011 08:20 PM
[SOLVED] command to do a ll with total folder size for each rjo98 Linux - Newbie 5 08-21-2009 04:15 PM
how to find folder size in Shell an_sush Linux - Newbie 3 11-17-2008 08:09 AM
how to find size increase most file or folder? jimmyjiang Linux - Server 1 07-16-2007 11:47 PM
Command folder size Ataraxos Linux - Newbie 8 04-03-2005 01:09 PM


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