How to Find Large Files in Linux

One of the most common problems we all face with our systems is identifying large files that take up precious disk space. Whether you are a seasoned Linux user or a beginner, efficiently managing disk space is a necessary skill everyone should know. In this article, we will discuss different methods to find large files in your Linux system to help you recover valuable disk space.

How to Filter Large Files with find Command

How to Filter Large Files with find Command

The find command in Linux is a powerful tool to search for files and folders based on your criteria. When combined with the appropriate options, you can find large files hogging up memory on your Linux system. To locate the large files in Linux using the find command, use this syntax:

In the above syntax:

For example, to search for files larger than 1GB in the current directory, the command is:

Whether large or small files, the find command is a life-saving Linux command. If you want to know more ways to use the find command, do check out our guide on

How to Find Large Files with du Command

How to Find Large Files with du Command

The du command (stands for “disk usage”) is another powerful and versatile command line tool used toanalyze the system disk usage in Linux. With the help of appropriate options, you can use it to find large files and folders in your Linux system. Use the following syntax to filter large files with the du command:

Seems complicated? Let’s break down the syntax here:

Say, if you want to find all the large files in the ~/Documents/test directory, use this Linux command:

If you want to see the amount of disk space acquired by different files and apps, check out our guide on different methods tocheck disk usage in Linux.

How to Find Large Files using ls Command

The ls command is the most basic yet powerful command. Generally, it is used to list the contents of a directory in alphabetical order. But with the help of some flags, you can use it to print all the large files in a directory as per this syntax:

In the above syntax:

For example, if you need to look for large files in the current directory on your Linux system, use this:

To find the 10 largest files in Linux, use this syntax:du -a -h <path_to_directory> | sort -n -r | head -10

To find all the files with a specific permission set, use this syntax:find <path_to_directory> -perm -type f. Replace<path_to_directory>with the directory, you want to search in andwith the absolute mode permissions.

Beebom Staff

Bringing the latest in technology, gaming, and entertainment is our superhero team of staff writers. They have a keen eye for latest stories, happenings, and even memes for tech enthusiasts.

Add new comment

Name

Email ID

Δ

01

02