Unix question: list all files, largest first?

Discussion in 'Mac Basics and Help' started by xmiinc, Dec 6, 2007.

  1. xmiinc macrumors newbie

    Joined:
    Nov 7, 2005
    Location:
    NYC
    #1
    A friend needs help identifying his largest files on a disk. I've come close in Terminal (ls, find), but haven't found the syntax to do the following:
    list all files, largest first, including path and file-size in megabytes.

    Can someone help me out? Thanks in advance...
     
  2. overanalyzer macrumors 6502a

    Joined:
    Sep 7, 2007
    Location:
    Boston, MA USA
    #2
  3. xmiinc thread starter macrumors newbie

    Joined:
    Nov 7, 2005
    Location:
    NYC
    #3
    Thanks! I'm sure these utils will be helpful (and I can continue trying to solve this via the cli...I'm curious that way)
     
  4. oblomow macrumors 68020

    oblomow

    Joined:
    Apr 14, 2005
    Location:
    Netherlands
    #4
    ls -alR | sort -n -k5,5

    (recursive directory listing, numerically sorted of the 5th item of each line, which is the size of the file)
     

Share This Page