Fedora Linux Support Community & Resources Center
  #1  
Old 11th April 2006, 07:59 AM
JordanN Offline
Registered User
 
Join Date: Sep 2004
Location: Fort Wayne, Indiana
Posts: 573
Show all files, sorted by size

I recently noticed that a 30 gig partition on my secondary partition is nearly full. This isn't particularly alarming, given that I have another 30 gig partition that is barely being used on the same drive.

However, I would like to find out whether I have some particularly large files sitting in there that I have forgotten about, which I could delete and free up some space.

I am looking for a console command that would display a list of all files in /mnt/files over 100 MB, sorted from largest to smallest. What is the best way to do this? Would this use "find"?
Reply With Quote
  #2  
Old 11th April 2006, 08:06 AM
LocutusOfBorg Offline
Registered User
 
Join Date: Aug 2005
Posts: 684
For the console command I admit I have no idea. If you want to try some graphic tools (which in displaying files and directories size are useful), I suggest kdirstat or the "disk usage" tool embedded in the last version of Krusader.
__________________
I am Bill of Borg. Resistance izkx GPF 0x5654 8820 Application
RESIST.EXE has performed an illegal operation and will be shut down.
Reply With Quote
  #3  
Old 11th April 2006, 10:14 AM
markkuk Offline
Registered User
 
Join Date: Apr 2005
Location: Finland
Posts: 5,075
Code:
find /mnt/files -size +100M -printf '%k\t%p\n' | sort -r -n
Reply With Quote
  #4  
Old 11th April 2006, 10:31 AM
JordanN Offline
Registered User
 
Join Date: Sep 2004
Location: Fort Wayne, Indiana
Posts: 573
Quote:
Originally Posted by markkuk
Code:
find /mnt/files -size +100M -printf '%k\t%p\n' | sort -r -n
Code:
[me@mycomputer ~]$ find /mnt/files -size +100M -printf '%k\t%p\n' | sort -r -n
find: invalid -size type `M'
Telling it to use kilobytes worked as expected, however.
Code:
[me@mycomputer ~]$ find /mnt/files -size +100000k -printf '%k\t%p\n' | sort -r -n

Last edited by greenlead; 11th April 2006 at 10:47 AM.
Reply With Quote
  #5  
Old 11th April 2006, 11:53 AM
daverj Offline
Registered User
 
Join Date: Jan 2006
Location: Denver, CO USA
Posts: 670
you don't need all the fancy find stuff. The following will work fine:

ls -ls | sort -n

the -s swith to ls outputs the file size. Then simply sort it.


Dave

edit: my bad... try ls -lS instead.

Last edited by daverj; 11th April 2006 at 11:57 AM.
Reply With Quote
  #6  
Old 11th April 2006, 02:27 PM
markkuk Offline
Registered User
 
Join Date: Apr 2005
Location: Finland
Posts: 5,075
Quote:
Originally Posted by greenlead
Code:
[me@mycomputer ~]$ find /mnt/files -size +100M -printf '%k\t%p\n' | sort -r -n
find: invalid -size type `M'
Telling it to use kilobytes worked as expected, however.
Size type M works in FC5, you didn't mention which Fedora version you have.
Reply With Quote
  #7  
Old 12th April 2006, 12:55 AM
JordanN Offline
Registered User
 
Join Date: Sep 2004
Location: Fort Wayne, Indiana
Posts: 573
Quote:
Originally Posted by markkuk
Size type M works in FC5, you didn't mention which Fedora version you have.
I am using FC3 (I was using FC4; I attempted an FC5 install, it didn't work out, so I went back to FC3 with the intent of playing with CCRMA some).

M is listed on the man page as a valid size option.

Code:
[me@mycomputer ~]$ find --version
GNU find version 4.1.20
Reply With Quote
  #8  
Old 12th April 2006, 12:58 AM
JordanN Offline
Registered User
 
Join Date: Sep 2004
Location: Fort Wayne, Indiana
Posts: 573
Quote:
Originally Posted by daverj
you don't need all the fancy find stuff. The following will work fine:

ls -ls | sort -n

the -s swith to ls outputs the file size. Then simply sort it.


Dave

edit: my bad... try ls -lS instead.
The right idea, but it needs to be recursive.
Reply With Quote
  #9  
Old 6th July 2006, 05:03 AM
JordanN Offline
Registered User
 
Join Date: Sep 2004
Location: Fort Wayne, Indiana
Posts: 573
Hey, I was wondering about this again.

I am using FC5 now, and markkuk's command works well. Thanks!
Reply With Quote
Reply

Tags
files, size, sorted

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
Downloaded files won't show on Desktop theAdmiral Using Fedora 14 27th April 2009 11:23 PM
fdisk/cfdisk/parted show full size on raid0, but df -h doesnt? AlmightyX Using Fedora 4 23rd July 2008 03:33 AM
Files won't show up / DVD / HAL / FSTAB Vetal Using Fedora 12 16th February 2007 04:14 PM
Samba won't show any files HaMBoNE79 Servers & Networking 5 18th July 2005 02:27 AM


Current GMT-time: 18:41 (Sunday, 20-04-2014)

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