Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-04-2005, 11:38 AM   #1
Registered: Aug 2004
Posts: 88

Rep: Reputation: 15
find size of directory

/usr is 92% full and filling up fast and I can't tell why! I'm trying to use du when in /usr but even when I use the -c parameter, it still prints out everything as it recurses through the directory. I just want a grand total. What's the quickest way to find out where all the space in my /usr is going to??? Thanks!

Also, at the end of typing

du -c

it just prints out this:

575940 .
575940 total

which doesn't look like very much even though /usr has 3344 1-M blocks!

Last edited by naijaguy; 03-04-2005 at 11:40 AM.
Old 03-04-2005, 11:53 AM   #2
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
du -hs /usr
That command will take quite a while (depending on the size of /usr), but it will print out only the size of /usr in human readable form (e.g. GB, MB, KB ... ).

Then, if you want to push in further, change the command slightly:
du -hs /usr/*
That will print out the size of all the immediate subdirectories in /usr in the same format as before.

Repeat as necessary.
Old 03-04-2005, 11:58 AM   #3
Registered: Aug 2004
Posts: 88

Original Poster
Rep: Reputation: 15
We used to have less than 30% used on /usr but this is what I see right now:

[root@app1 usr]# df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/sda5 18577 16533 1101 94% /
/dev/sda3 99 16 79 17% /boot
none 2008 0 2008 0% /dev/shm
/dev/sda11 1012 33 928 4% /tmp
/dev/sda6 3344 2900 274 92% /usr
/dev/sda12 641 148 462 25% /var
/dev/sda2 2317 66 2133 3% /home

Does anything below look strange?

[root@app1 usr]# du -hs /usr/*
126M /usr/bin
4.0K /usr/dict
4.0K /usr/etc
4.0K /usr/games
22M /usr/include
154M /usr/java
4.2M /usr/kerberos
784M /usr/lib
6.3M /usr/libexec
564M /usr/local
16K /usr/lost+found
39M /usr/sbin
820M /usr/share
258M /usr/src
0 /usr/tmp
94M /usr/X11R6

[root@app1 usr]# du -hs /usr
2.9G /usr
Old 03-04-2005, 12:11 PM   #4
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Does anything look strange? That's not an easy question to answer. It all depends on what's installed on the system, where it's installed, where to store data files, etc.

If you're looking for a suggestion, then I'd continue looking into /usr/share and /usr/lib. Those are the biggest space consumers listed:
du -hs /usr/share/*
du -hs /usr/lib/*
Keep pushing further in until you find the directory that has lots of files you don't recognize or that shouldn't be there.


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
getting the directory size in c rajesh_b Programming 7 01-06-2005 07:41 AM
directory size chandan Linux - General 3 06-26-2003 09:51 AM
directory size santoshgnag Linux - General 1 06-26-2003 05:00 AM
Directory size Steave Linux - General 4 09-03-2001 05:13 AM
Directory Size Helixx Linux - General 1 04-27-2001 09:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration