Display all directory/sub directory with occupied space?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Display all directory/sub directory with occupied space?
# 1  
Old 08-03-2010
Display all directory/sub directory with occupied space?

Hello,

I am using Red Hat linux system. I see my /work directory has used space 300GB. But there are so many sub directory under /work. I want to list each direcotry and under all subdirectory. But i want to know how much space occupied by each directory. What kind of command i can use to achieve this?

Any help is appreciated...

Thanks.
# 2  
Old 08-04-2010
The command is du:
Quote:
du: Summarize disk usage of each FILE, recursively for directories.
For example: if you want to get how much space is used by each subdirectory you can do something like:
Code:
find . -maxdepth 1 -type d | xargs du -m -s

This command finds each first-level subdirectory from current path, and prints how much space (in Mb) is used by each one.
Is this enough?

Albert.
# 3  
Old 08-04-2010
Thank you Albert!! It helps..
# 4  
Old 08-09-2010
Thank you!!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

2. UNIX for Dummies Questions & Answers

How to display only Owner and directory/sub directory names under particular root

hai, I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc". (here "oasitqtc" is the owner of the directory or sub directory.) i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
Discussion started by: gagan4599
6 Replies

3. UNIX for Dummies Questions & Answers

Space occupied by core

Guys, Can some one help me? I need to find the total percent of space occupied by core files on my unix system. I know df -k will give me the percent space utilization for a directory but how do we replicate the space for a file? (3 Replies)
Discussion started by: yabhi_22
3 Replies

4. Shell Programming and Scripting

script to display occupied and non occupied ports in unix

I want to extend this script. This must also be able to show me that a port is already assigned to a service but not running now there must be three different messages port 8949 is open but not listening port 8959 is open port 8999 hasn't been assigned to any service. I know that... (1 Reply)
Discussion started by: charan314
1 Replies

5. UNIX for Dummies Questions & Answers

Display directory size

Hi all, Is there any built in function that can display the content of a directory showing the size of directories? I want to see the content of a directory without recursion. I don't want to see the content of all subdirectories. I want to see the contained files with their size and the... (6 Replies)
Discussion started by: chebarbudo
6 Replies

6. Shell Programming and Scripting

how to display the permission of the home directory

can anyone tell me how to display the permissions of a users home directory. can i use ls -l but it only gives the permissions of the files and directories inside the directory..:confused::confused::confused::confused: (9 Replies)
Discussion started by: nadman123
9 Replies

7. Solaris

Command used for checking space occupied by files & sub-direc's inside a mount in %?

Hi, I want to know the command which can be used for finding the % of disk space occupied by files & sub-folders inside a given mount in Sun Solaris For eg: I have /tmp/ folder when I sat df -k it will give the percentage of space used by /tmp/. Say if I want to see how much % the files &... (2 Replies)
Discussion started by: weblogicsupport
2 Replies

8. UNIX for Dummies Questions & Answers

Display Directory Size - DF?

How can I display the size of a directory and contents witin a directory df only gives me the mounts (3 Replies)
Discussion started by: t4st33@mac.com
3 Replies

9. UNIX for Advanced & Expert Users

Space in the directory name

I've got a small script that deletes all the trash from mailusers Trash directory. I run this script once in a while to make some space. (We have lots of IMAP users, who keep their mail on server!) Occansionaly, the users create directories with space in the name (e.g. "My Mail"). And sometimes... (5 Replies)
Discussion started by: nitin
5 Replies
Login or Register to Ask a Question