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-17-2008, 07:40 PM   #1
rusty_turkey
LQ Newbie
 
Registered: Oct 2005
Location: Queensland, Australia
Distribution: Solaris
Posts: 14

Rep: Reputation: 0
Question Howto? List all files in all directories ordered by size?


How can you list ALL files on a machine, ordered by file size?
(Solaris)
 
Old 06-17-2008, 08:31 PM   #2
tim1602
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
There are a couple of ways.

If you can read as fast as the symbols going by your eyes when you use the matrix like screen saver then just use this:

ls -SR /

That breaks down to ls (list) -S (put in order by the file size) R (recursive, it follows the subdirectories)

All you have to do is add an "lh" in between the SR and you will get the file size in human readable format.

This will scream by, at a mind numbing pace, so I would pipe it to a file. The entire way that I would recommend is as follows:
ls -SlhR / > biglistoffiles.txt

Good luck, and may the penguin be with you.
 
Old 06-17-2008, 08:55 PM   #3
rusty_turkey
LQ Newbie
 
Registered: Oct 2005
Location: Queensland, Australia
Distribution: Solaris
Posts: 14

Original Poster
Rep: Reputation: 0
answer

Thanks for your reply. I should have been a bit more specific - i.e. list only files and not directories, and order by file size...

I did end up figuring something out after looking at related posts and using awk and sort (haven't really used them before).

find / -type f -ls | awk '{print $2, $11}' | sort -rn
 
  


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
javascript validation of ordered list rblampain Programming 0 07-28-2007 05:51 AM
List all files in multiple directories haiders Linux - Newbie 6 05-10-2007 01:05 PM
Getting a list of directories with certain files inside... Banacek Linux - Newbie 7 11-27-2006 06:43 PM
Insert an ordered list into your message SidA Red Hat 0 06-19-2004 08:49 PM
list size of directory and all directories it contains? ubien Linux - General 2 01-11-2003 11:59 AM


All times are GMT -5. The time now is 10:45 PM.

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