Share your knowledge at the LQ Wiki.
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 06-18-2007, 06:34 AM   #1
LQ Newbie
Registered: Jun 2007
Posts: 1

Rep: Reputation: 0
How to know all details of data in a partition

I am newbiew in Linux

The following command gives me the filsystem.

[root@CTX ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 12G 9.3G 1.7G 85% /
/dev/hda1 494M 14M 456M 3% /boot
/dev/hda5 23G 8.1G 14G 38% /data
none 756M 0 756M 0% /dev/shm

Now, I want to know all data in Filesystem /dev/hda2
or / partition. so that i can free up some space.

My question is /dev/hda2 shows 9.3G used, i want to know all data directory and files conusiming this space.

so that i can free up some space in this partition.
Old 06-18-2007, 07:31 AM   #2
Registered: Apr 2004
Distribution: CentOS6, CentOS5, F16, F15, Ubuntu, OpenSuse
Posts: 620

Rep: Reputation: 39
Use the 'du' command: 'man du'.

# cd /
# du -sh *
Old 06-18-2007, 07:33 AM   #3
Registered: Jun 2005
Location: UK
Distribution: Debian
Posts: 189

Rep: Reputation: 41
There is a little command line tool called tree that might help. You may have to install it for your distribution.

The command;

tree / -x|less

will list all the files from root downward. But the x option will stop it leaving the starting partition. So you should get a listing without the content of /boot/ or /data/

However, judging from your df output, only boot and data are on other partitions. I assume data is your own doing and boot wont contain much at all. So your best bet for freeing up space will probably be to either remove packages/software or clean up your home directory.

What distribution are you using? (it helps if you add this to your user details)
Old 06-18-2007, 07:47 AM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Go to the mount point for the partition and type "ls -lR > ~/filename". You will now have a file in your home directory which lists the entire content of that partition. You can now search this for things. e.g., to list just all of the directories:
cat filename | grep '^d' |more


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
Re-partition without losing data goodtogo Linux - Software 4 06-22-2007 08:20 AM
Data Transfer From Redhat Linux Partition to Fat32 Partition saraturtle Linux - General 20 04-04-2007 05:20 PM
Partition without Data Loss SirJinX Linux - Software 9 08-26-2006 12:25 AM
Recoving Data from Other Partition PulsarSL *BSD 4 06-26-2005 01:37 PM
Data on Partition deleted rahulnsoni Linux - Newbie 5 05-01-2004 05:58 AM > Forums > Linux Forums > Linux - Newbie

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