Visit Jeremy's Blog.
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 11-25-2006, 01:41 AM   #1
LQ Newbie
Registered: May 2006
Distribution: ubuntu , Win XP
Posts: 29

Rep: Reputation: 15
some simple questions about hard disk

i am newbie so , How can...
1) i get the spaces (in MB) that is occupied in a linux partition?
2) i get the spaces (in MB) that is free in a linux partition?

3) i get the spaces (in MB) that is occupied in a linux directory?
4) i get the spaces (in MB) that is free in a linux hard disk?

thanks a lot
Old 11-25-2006, 02:35 AM   #2
Registered: Apr 2003
Location: Wisconsin
Distribution: Switched to regualr Ubuntu, because I don't like KDE4, at all. Looks like vista on crack.....
Posts: 675

Rep: Reputation: 31
at the command line type

df -h

for a file type

du -h /this/is/the/file/name
Old 11-25-2006, 02:51 AM   #3
Senior Member
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
df shows you available, remaining, and total space on mounted partitions. the -h option gives it you in a "nice human readable" format using K, M, etc as appropriate. The -m and -k options will instead show it to you as number of 1K or 1M blocks.

Use du to see how much space is used by a directory and its subdirectories.

Running fdisk -l as root will show show the sizes of partitions on your disks and any unused space. There is likely one or more other partitioning tools in your distro that will also give you this info.

On all of these (and most other commands), consult the man pages for more info, including all of the options and what they do. For example, to find out info about df, type:

man df

Your distro/DE may also have graphical tools for some or all of this. If you wish somebody to post about that info, you should post what distro, and if possible, what desktop environment (KDE, Gnome, etc) you are using.
Old 11-25-2006, 03:47 AM   #4
LQ Newbie
Registered: Nov 2006
Posts: 16

Rep: Reputation: 0
running info df will show information regarding df order
Old 11-25-2006, 07:20 AM   #5
LQ Newbie
Registered: May 2006
Distribution: ubuntu , Win XP
Posts: 29

Original Poster
Rep: Reputation: 15
thanks again


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
Questions about adding a second hard disk to install more distros wongfoo Linux - Newbie 18 03-18-2006 03:48 PM
Linux on second hard drive. Simple questions pmo10 Linux - Hardware 3 01-16-2005 11:48 PM
Hard Disk Drive Questions Cyberian Linux - Hardware 3 01-02-2005 12:44 AM
hard disk questions mfeat Linux - Hardware 3 08-26-2004 10:04 AM
two hard-disk setup questions jamaso Linux - Hardware 10 03-24-2003 12:28 PM > Forums > Linux Forums > Linux - Newbie

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