Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30th December 2008, 03:52 AM
cranium Offline
Registered User
 
Join Date: Sep 2006
Posts: 65
Determine the directories/files on a partition

Hey All,

I have a partition (hda6) that is 86% full and I would like to know exactly what is on this partition so I can see if there are directories or files or parts of files that I can delete to lessen the load on this server. So is there a command that allows you to see the directories and/or files on a particular partition?

Thank you for your time and help,
cranium
Reply With Quote
  #2  
Old 30th December 2008, 04:17 AM
scottro's Avatar
scottro Offline
Retired Community Manager -- Banned from Texas by popular demand.
 
Join Date: Sep 2007
Location: NYC
Posts: 8,142
Are you familiar with ls? That will give a listing of the files, color coded by default.

There is also du -sh which will give you the files and their size.
You can do ls -S which will sort by size. ls -lS will give you the size as well as sorting by size.
There's a bunch of different ways to do it. You could start with something like du -sh |grep G which will only show things that are at least one gig in size, as well as any other files with a capital G in their name.
Reply With Quote
  #3  
Old 30th December 2008, 04:26 AM
cranium Offline
Registered User
 
Join Date: Sep 2006
Posts: 65
Thank you for the reply. I am familiar with ls but I don't know how that will actually give me the partition that the directories and/or files are located on. I need to them specific to a particular hard drive partition????
Reply With Quote
  #4  
Old 30th December 2008, 04:35 AM
stevea's Avatar
stevea Online
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,302
ls, mc, nautilus, thunar, df, kfm ... there are dozens of tools.

Mount the file system somewhere and then start looking for the size of directories w/
df -s --si /media/disk/*
as a starting point.
Sometimes just seeing all the directory names helps
find /media/disk -type d | less
or maybe just the big file
find /etc -size 5M | xargs ls -l
Reply With Quote
  #5  
Old 30th December 2008, 06:17 AM
weitjong's Avatar
weitjong Online
Registered User
 
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 745
There is also a graphical application called baobab (Disk Usage Analyzer) that I find it useful to hunt down the directories containing large files. I am not saying it is better then CLI tools. Just point out the available option.
__________________
YaoWT - Leave no window unbroken ^_^
Reply With Quote
  #6  
Old 30th December 2008, 01:42 PM
Sauron Offline
Registered User
 
Join Date: Jan 2005
Posts: 257
type 'mount' at a command prompt, it'll show you the top-level directory where each partition is mounted:

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)

so my / is an LVM
/dev/sda1 is mounted at /boot

So you need to find where /dev/hda6 is mounted at and can figure out what directories are on it from there. It does get complicated if /dev/hda6 is / because you might have other partitions mounted underneath it (/boot in my case) which do not contribute to /dev/hda6's usage.
Reply With Quote
  #7  
Old 30th December 2008, 01:59 PM
vallimar Online
Registered User
 
Join Date: Jul 2008
Posts: 811
Using "df -Th' is a much prettier way to display useable mounts.
If you want a console tool, stick with "du", use the "-x" to not include other partitions in the calculations.
See the manpage on "du" for more info, it was made for what you want.
Reply With Quote
Reply

Tags
determine, directories or files, partition

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting files in sub-directories Wayne Using Fedora 16 21st December 2006 12:01 AM
Configuration files and directories not being used Jongi Using Fedora 4 4th September 2006 12:27 PM
able to sftp files. what about directories? bowie101 Servers & Networking 3 3rd May 2006 11:33 PM


Current GMT-time: 13:23 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat