LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 12: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, 12:31 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
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 12:54 PM. Reason: Typo
 
Old 02-22-2009, 12:37 PM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

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

Rep: Reputation: 174Reputation: 174
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, 02: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, 02: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, 02:59 PM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
du -a -b | sort -g | head
tail would be better, no?
 
Old 02-22-2009, 03: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, 03:16 PM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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, 03:20 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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 03:41 PM.
 
Old 02-22-2009, 03: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, 07:06 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02: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
Open Source Consulting | Domain Registration