LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 06-24-2005, 12:26 PM   #1
glaz
Member
 
Registered: Jun 2004
Posts: 58

Rep: Reputation: 15
linux df command


Is there a way to run some command (maybe df) under linux RedHat 7 to display the memory used for the file system. When i do df, it simply shows me the hard disk partitioning space, but i need to see what the file system space allocation is.
For example i need to see this: (This was done on unix Solaris)
$ df
/ (/dev/dsk/c0t0d0s0 ): 525518 blocks 291846 files
/usr (/dev/dsk/c0t0d0s6 ):13617292 blocks 1600490 files
/proc (/proc ): 0 blocks 29913 files
/dev/fd (fd ): 0 blocks 0 files
/etc/mnttab (mnttab ): 0 blocks 0 files
/var/run (swap ): 2999904 blocks 218303 files
/tmp (swap ): 2999904 blocks 218303 files
/export/home (/dev/md/dsk/d0 ):12725334 blocks 3021243 files
/usr/old-basecode (/dev/dsk/c2t5d0s7 ):43155254 blocks 3021401 files
/usr/old-develop (/dev/dsk/c2t5d1s7 ):96311384 blocks 6381718 files
/usr/develop (condor:/develop1 ):1058587144 blocks 144717366 files
/snap (condor:/home1 ):1058587144 blocks 144717366 files
/home/mysql (condor:/home1/mysql):1058587144 blocks 144717366 files
/home/rgb (condor:/home1/rgb ):1058587144 blocks 144717366 files
/usr/basecode (condor:/basecode1 ):1058587144 blocks 144717366 files
/home/greg (condor:/home1/greg):1058587144 blocks 144717366 files

I need to see similar under linux.
TIA.
 
Old 06-24-2005, 12:53 PM   #2
azucaro
Member
 
Registered: Jan 2005
Location: Washington, D.C.
Distribution: Arch (Custom), CentOS
Posts: 239

Rep: Reputation: 30
df -h /filesystem/to/check/ (human readable)

or

df -k /filesystem/to/check/ (in kilobytes)

I usually just navigate to the filesystem I want to see and type " df -h . " to see its usage.
 
Old 06-24-2005, 01:04 PM   #3
glaz
Member
 
Registered: Jun 2004
Posts: 58

Original Poster
Rep: Reputation: 15
This is what i get when i do what you said, still tells me the space of /dev/hda3, not the spae of /tmp

[greg@localhost tmp]$ df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 72G 7.3G 61G 11% /
 
Old 06-24-2005, 01:10 PM   #4
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
Quote:
Originally posted by glaz
This is what i get when i do what you said, still tells me the space of /dev/hda3, not the spae of /tmp

[greg@localhost tmp]$ df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 72G 7.3G 61G 11% /
You are using the wrong command if you want to see the size of a directory.
df -> report filesystem disk space usage
du-> estimate file space usage

try
Code:
du -hs /tmp
 
Old 06-24-2005, 01:13 PM   #5
yoursmile
LQ Newbie
 
Registered: Jun 2005
Posts: 26

Rep: Reputation: 15
Code:
du /  -h
or

Code:
 du /usr -h --max-depth=1
 
Old 06-24-2005, 01:21 PM   #6
azucaro
Member
 
Registered: Jan 2005
Location: Washington, D.C.
Distribution: Arch (Custom), CentOS
Posts: 239

Rep: Reputation: 30
Sorry bout that. I was wrong about the last argument. But you can type df -h to see similar output for all filesystems on your machine. At least on Solaris 8 it does that

Cheers.
 
Old 06-24-2005, 01:32 PM   #7
glaz
Member
 
Registered: Jun 2004
Posts: 58

Original Poster
Rep: Reputation: 15
So does that give me the size of current directory or the allocated space for it.
Like i tried those commands and it give me this:

[root@localhost /]# du -h /tmp
8.0K /tmp/orbit-root
4.0K /tmp/.iroha_unix
4.0K /tmp/.font-unix
4.0K /tmp/.X11-unix
4.0K /tmp/.ICE-unix
4.0K /tmp/ssh-KhqC4076
4.0K /tmp/.esd
40K /tmp

What do these numbers mean. I'm mainly interested in how much space linux allocates to /tmp or /usr directory and how much of it have I used up.

Yes azucaro, df works that way in Solaris under unix, but seems to be different in linux.
 
Old 06-24-2005, 02:00 PM   #8
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
Quote:
Originally posted by glaz
So does that give me the size of current directory or the allocated space for it.
Like i tried those commands and it give me this:

[root@localhost /]# du -h /tmp
8.0K /tmp/orbit-root
4.0K /tmp/.iroha_unix
4.0K /tmp/.font-unix
4.0K /tmp/.X11-unix
4.0K /tmp/.ICE-unix
4.0K /tmp/ssh-KhqC4076
4.0K /tmp/.esd
40K /tmp

What do these numbers mean. I'm mainly interested in how much space linux allocates to /tmp or /usr directory and how much of it have I used up.

Yes azucaro, df works that way in Solaris under unix, but seems to be different in linux.
This shows you the size of every file in the /tmp directory as it should.
If you read my post you shall see a "du -hs /tmp"
Quote:
-s, --summarize
display only a total for each argument
In the command you have used the last line is what you are looking for.
 
Old 06-24-2005, 02:16 PM   #9
glaz
Member
 
Registered: Jun 2004
Posts: 58

Original Poster
Rep: Reputation: 15
but how do i know what is the limit for the /tmp or /usr
Doesn't linux put caps on them
 
Old 06-25-2005, 10:50 AM   #10
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
Quote:
Originally posted by glaz
but how do i know what is the limit for the /tmp or /usr
Doesn't linux put caps on them
No, by default the limit of a directory is the size of the partition containing it.
If you want to limit it you may put quota in the users.
 
  


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
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 02:23 AM
Linux command sixth_sense Linux - General 4 04-13-2005 02:33 AM
Need some help with linux command NiallC Linux - Newbie 2 11-11-2004 02:47 AM
unix command to linux command leonidas Linux - General 1 09-10-2004 12:40 AM
Linux Command Haroon Linux - General 3 09-07-2004 04:54 AM

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

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