LinuxQuestions.org
Visit Jeremy's Blog.
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-18-2007, 07:34 AM   #1
luv_raj11
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, 08:31 AM   #2
mjmwired
Member
 
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, 08:33 AM   #3
redgoblin
Member
 
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, 08:47 AM   #4
pixellany
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
 
  


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


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