#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    Exclamation How to list all files in dir's and sub-dir's recursively along with file size?


    Hi,

    I am new to unix, now i have a requirement to display all the files in dir's and sub-dir's recursively along with file path and size info in decending order.

    expected o/p will be in below format

    20kb file1 /dir/sub-dir/file1
    10kb file2 /dir/sub-dir/file2
    ....................................
    .....................................

    please help me..
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2004
    Location
    Kostolac, Serbia
    Posts
    855
    Rep Power
    1391
    du
    Code:
    du -ah
    EDIT: Sorry, I just saw the descending order requirement. You can find plenty of scripts online doing these kind of things, from sorting to displaying other statistical info. Have a look here http://serverfault.com/questions/145...k-usage-report
    Last edited by holodoc; October 27th, 2010 at 05:39 AM.
    PHP Code:
    <?php
    abstract class Ignorance extends Stupidity implements Unavoidable 
         public static 
    $humiliation

         private function 
    __construct(){
            
    parent::__destruct();
         }; 

    ?>
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    168
    Rep Power
    7
    du -ka | sort -nr

IMN logo majestic logo threadwatch logo seochat tools logo