System Administration Guide

How to Find Large Files

  1. Change directory to the location where you want to search.

  2. Display the size of files in blocks from largest to smallest.


    $ ls -s | sort -nr | more
    

    sort -nr

    Sorts the list of files by block size from smallest to largest. 

Example--Finding Large Files

In the following example, wtmpx and lastlog are the largest files in the /var/adm directory.


$ cd /var/adm
$ ls -s | sort -nr | more
 320 wtmpx
 128 lastlog
  74 pacct
  56 messages
  30 wtmp
   6 utmpx
   2 utmp
   2 sulog
   2 sa
   2 passwd
   2 log
   0 spellhist
total 624