LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-22-2009, 01:16 PM   #1
SuperDude123
Member
 
Registered: Nov 2008
Posts: 158

Rep: Reputation: 30
what is using disk space ?


Is their a way to list the largest folder or files to the smallest so that I can see what and where my disk space is being used?
 
Old 02-22-2009, 01:31 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2beta2 on Lenovo Thinkpad W520
Posts: 6,774

Rep: Reputation: 2113Reputation: 2113Reputation: 2113Reputation: 2113Reputation: 2113Reputation: 2113Reputation: 2113Reputation: 2113Reputation: 2113Reputation: 2113Reputation: 2113
You can use the 'find' command for that.

To know how-to use it: 'man find' and (even better) 'info find' (type that without the quotes).

Tip: if you are not used to the 'info' command and have Konqueror installed, you can type 'info:find' (without the quotes) as an URL to display it as web pages. Works for the manual too: type '#find' or 'man:find'.

Last edited by Didier Spaier; 02-22-2009 at 01:54 PM. Reason: Typo
 
Old 02-22-2009, 01:37 PM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
du -h
 
Old 02-22-2009, 01:44 PM   #4
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,389

Rep: Reputation: 101Reputation: 101
Ubuntu has a "Disk Usage Analyzer" utility installed by default. If you do not have something similar... the app is a part of gnome-utils. If you are running gnome you should be able to install it. If you are running kde I am sure there is a similar tool.

Ken
 
Old 02-22-2009, 03:26 PM   #5
palisetty_suman
Member
 
Registered: Feb 2007
Location: TX, USA
Distribution: fedora
Posts: 191

Rep: Reputation: 33
Thumbs up Disk usage

Yes there is a way to see the files or directories which r using maximam disk space.The sorted form is like this. The command is

du -a -b | sort -g

All the Best.
 
Old 02-22-2009, 03:43 PM   #6
palisetty_suman
Member
 
Registered: Feb 2007
Location: TX, USA
Distribution: fedora
Posts: 191

Rep: Reputation: 33
Thumbs up Hi

If you want only to see the top 10 files using maximan space, use head command

du -a -b | sort -g | head
 
Old 02-22-2009, 03:59 PM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
du -a -b | sort -g | head
tail would be better, no?
 
Old 02-22-2009, 04:09 PM   #8
palisetty_suman
Member
 
Registered: Feb 2007
Location: TX, USA
Distribution: fedora
Posts: 191

Rep: Reputation: 33
Thumbs up Hi repo

Hi repo,

r u teasing me r just expressing ur view. If u r teasing, its not good but if u r expressing ur view, its fine.

Tail would be better if he wants the least space used files.
 
Old 02-22-2009, 04:16 PM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
It's not just a point of view, it is a matter of fact: to see the largest files after having sorted them numerically, you have to extract the last part of the list using tail, instead of head:
Code:
du -a -b * | sort -g | tail
numerical sorting put them in increasing order, so that the last ones are the largest in size.
 
Old 02-22-2009, 04:20 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Code:
repo@cannabis:~/doc/guides$ du -a -b | sort -g | head
43	./apache.cookbook.html/files/pixel.gif
55	./apache.cookbook.html/icons/0.gif
67	./apache.cookbook.html/icons/99.gif
69	./apache.cookbook.html/icons/90.gif
69	./apache.cookbook.html/icons/92.gif
71	./apache.cookbook.html/icons/91.gif
78	./apache.cookbook.html/arch_css.css
79	./apache.cookbook.html/icons/98.gif
81	./apache.cookbook.html/icons/95.gif
81	./apache.cookbook.html/icons/96.gif
Code:
repo@cannabis:~/doc/guides$ du -a -b | sort -g | tail
3843544	./The Linux Cookbook Tips and Techniques for Everyday Use.pdf
3856123	./E6844v1.0.pdf
3952640	./rute.html.tar
5674255	./linux-cursus_door_Koen_Wybo.pdf
10631201	./Linux Complete Command Reference.pdf
11243520	./Novell - SUSE Linux 10.0 Reference (2005).pdf
15806552	./Helix0307.pdf
16450896	./Belkin router.pdf
27049039	./Linux Bible 2008 Edition.pdf
108233348	.
repo@cannabis:~/doc/guides$

Last edited by repo; 02-22-2009 at 04:41 PM.
 
Old 02-22-2009, 04:48 PM   #11
palisetty_suman
Member
 
Registered: Feb 2007
Location: TX, USA
Distribution: fedora
Posts: 191

Rep: Reputation: 33
Thumbs up repo

Sorry sir, you r exactly right. I accept my mistake.
If he still wants to use head we can add one more option to sort and can run


du -a -b |sort -g -r | head
 
Old 02-22-2009, 08:06 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
And while we're at accepting corrective feed-back ... would it be
too much trouble for you to use English instead of SMSish? It just
ruins the feel of a very professional board.


Cheers,
Tink
 
  


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
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 01:57 PM
hard disk partitioning/I am out of space /how to increase linux space? RMLinux Red Hat 8 09-05-2008 01:33 PM
add space to / when from spare space on disk ctsiow Linux - General 4 11-07-2007 08:55 AM
Cedega "Disk space required for the installation exceeds available disk space" Solved Spewdemon LinuxQuestions.org Member Success Stories 1 10-18-2007 07:19 PM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 04:58 PM


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