Find Files Smaller Than X KB in Linux

Last updated on Dec 29, 2019 in Linux

If you have to find files that are smaller than a particular file size, you can use find command to do the job.

First, go to your folder where to start the find and type:

$ find . -type f -size -5k

This outputs all the files that are smaller than 5k and are located under the current folder (and subfolders).

  • . is the starting folder, which is the current folder in this case
  • -type f means that we want to search only files, not directories or anything else
  • -size means that we want to search by size of the file
  • -5k is the size

You can find by any file size threshold, as well. Here is a guide:

  • c is bytes
  • k for kilobytes
  • M for megabytes
  • G for gigabytes

See also: Find Files Larger Than 1GB in Linux