Home Linux Commands How to Find Files Larger or Smaller Than a Specific Size in Linux

How to Find Files Larger or Smaller Than a Specific Size in Linux

Being a Linux user, managing files and directories efficiently is crucial, especially when dealing with a large number of files. Sometimes, you may find yourself in a situation where you need to locate files of specific sizes to free up disk space or perform some other administrative tasks.

Luckily, Linux offers powerful commands that allow you to find files with specific sizes effortlessly by using the popular find command.

In this article, we will explore various methods to locate kilobyte-sized files, making it easier for you to understand the process of searching files by size.

Pinpointing kilobyte-sized files can be a crucial technique as it allows you to zoom in on those smaller, yet significant, files that might be affecting your system’s performance or taking up more space than necessary.

1. Find Files with a Specific Size

Let’s begin this tutorial by searching all the files that have a specified size by using the “find” command.

To do so, we can use the syntax mentioned below.

$ find . -type f -size <size_of_file>

Here is the breakdown of the above syntax:

  • -type – This flag allows you to define the type of file or directory that you want to locate. It can be used with multiple arguments depending on your requirements.
  • f – This flat directs the terminal to search for regular files only.
  • -size – This flag defines the size of the file that you want to search or find.
  • size_of_file – You can define the size of the file in bytes (denoted by “c”), kilobytes (denoted by “k”), megabytes (denoted by “M”), gigabytes (denoted by “G”), and terabytes (denoted by “T”). For instance, if you’re looking for files that are exactly 60 kilobytes, you can enter “60k” as the size parameter.

Note: Regular files are common types of files that can store user data including text, binary data, and documents in Linux.

Let’s see an example, to find all the files that are exactly 50 kilobytes in size within the current directory and its subdirectories.

$ find . -type f -size 50k
Find Files by Size in Linux
Find Files by Size in Linux

The output will display all the files which are exactly 50 Kilobytes in size.

2. Find Files Larger Than a Specified Size

Moving forward, we can also use the “+” symbol before the file size to locate all the files larger or equal to the defined file size.

Let’s execute this command mentioned below to find the regular files that have a size equal to or larger than 1 Kilobyte:

$ find . -type f -size +1k
Find Files Greater Than Size
Find Files Greater Than Size

3. Find Files Smaller Than a Specified Size

Now that you know how to search for files that have a file size equal to or larger than the mentioned file size. It’s time to discuss a similar case of searching for files equal to or less than the defined size by using the “-” sign before the file size.

To find all files that are 200 Kilobytes or smaller in size, simply execute the following command:

$ find . -type f -size -200k
Find Files Smaller Than Size
Find Files Smaller Than Size

4. Find File Sizes by Extension

The find command also offers more flags that can aid the users in locating the desired files or directories in Linux.

One such flag is “-name”, which defines a pattern to specify the filename or extension you want to find. Moreover, you can combine two or more flags in the find command to match your needs.

To display all the files with sizes less than 100 kilobytes and the “.conf” extension in its filename:

$ find . -type f -size -100k -name *.conf
Find File Sizes by Extension
Find File Sizes by Extension

All the files in the output are configuration files with a size equal to or less than 100 Kilobytes.

5. Find Files Within a Specific Size Range

We can also find a file by specifying a certain file size range. As we have learned, the use of "+" and "-" signs with the file size in Kilobytes. To define a certain range for the file size, you can easily guess what we are going to do.

Yes, we are going to use "-size" twice!!! Once with the "+" sign and once with the "-" sign.

Let’s try this out by executing this command to search for files greater than 10kB but smaller than 50kB:

$ find . -type f -size +10k -size -50k
Find Files by Specific Size Range
Find Files by Specific Size Range

The size of files obtained by the execution of the above command will lie within the range of 10kB to 50kB.

6. Print File Sizes with Location

Lastly, we can also use the “-printf” flag to know the location of the file having a particular size. The arguments that are used with the “-printf” flag are “%p %k KB\n”, as these arguments specify how the output will be displayed on the screen.

Run the command stated below to understand its use:

$ find . -type f -size 296k -printf "%p %k KB\n"

Here is the breakdown of the above syntax:

  • -printf – This flag is used to customize the output format of the found files.
  • %p – This indicates the path of the file found.
  • %k – This indicates the size of the file in Kilobytes.
  • KB – The size will be continued with the word “KB” in the output.
  • \n – This moves each output to a new line.
Print File Sizes with Location
Print File Sizes with Location

Now you can also see the size of the file along with its path.


Mastering the art of locating files with a specific size in Linux using the find command opens up a realm of possibilities for efficient file management and resource utilization.

Whether you’re conducting system maintenance, managing disk space, or simply curious about where large files reside on your system, the find command empowers you with precise control over your file searches.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.