LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-01-2006, 11:21 AM   #1
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Rep: Reputation: 15
find where space is being used?


I have a server with cpanel installed. I ran the cpbackup script last night to do a backup of some sites to my home computer over ftp. when I checked it thismorning, it looked like putty disconnected or something and the backup didn't finish. I'm not sure if there are temp files from that taking up space someplace, but I think my disk usage is higher then it should be.

how can I find where the most space is being used? I know there are a bunch of programs for windows to do graphs of your whole directory structure, but my server is centos (redhat enterprise) without a gui. what can I do to find where the space is being used?
 
Old 04-01-2006, 11:45 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044
The command is 'du -h'

This will recurse into directories and show the file size of every file, and the total of every directory.

Now if you have 3495634756876 files on your machine and 8593048 directories that doesn't help much. To show only the really large files/directories, use:

'du -h | grep ^[0-9][0-9]M*'

to show all files or directories over 10 MB. Adapt the regexp as necessary :-)

jlinkels
 
Old 04-01-2006, 12:30 PM   #3
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Rep: Reputation: 30
Konqueror has a nice integrated size oriented filesize thingy.

Try this: http://www.marzocca.net/linux/baobab.html
It appeared on Linux Magazine recently...
 
Old 04-01-2006, 01:16 PM   #4
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
I find the following command to be very handy
Code:
du -h --max-depth=1
It will give give you the total amount of space that each subdirectory is using
 
Old 04-01-2006, 05:21 PM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044
J.W. You are right about that, but if you have a large directory somewhere buried deep down there you have to descend into it manually.

jlinkels
 
Old 04-02-2006, 12:28 AM   #6
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
thanks. works good. now, next problem. what is the command to double my hard drive size?..

is there a simple way to span raid a partition in linux? like add another drive to the /home partition? I wouldn't want it to have a different name like home2 or something, and not a subdirectory of /home, any way to do that easy?
 
Old 04-02-2006, 03:23 AM   #7
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Quote:
Originally Posted by jlinkels
J.W. You are right about that, but if you have a large directory somewhere buried deep down there you have to descend into it manually.
Yes and No. Note that you can set max-depth to 2 or 3 or whatever.

Don't get me wrong, both your suggestion and mine are basically the same thing, but if you've got a lot of files the output from running "du -h" can be overwhelming. Combining it with the max-depth option can provide a very useful, high-level view of the system
 
  


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
Find dir space yhus Programming 10 03-14-2006 07:32 AM
how to find directories with a space in it :P ToBe Linux - General 4 01-05-2005 01:10 PM
How to find free space available in media praveenmohan Solaris / OpenSolaris 2 11-28-2003 07:10 AM
how do i find out what space my hd is waheedrafiq Linux - General 13 06-08-2003 04:06 PM
How do i find out how much disk space i have Fathonkey Linux - General 5 06-07-2003 03:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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