Linux is very similar to other operating systems you may have used in the past, such as Windows, macOS (formerly OS X), or iOS. Linux features a graphical user interface, similar to other operating systems, and the same types of software you are used to using such as word processors, photo editors, video editors, etc. A software designer would often create a Linux version of the same program you use on other operating systems. On a particular system, we all get to the point where we start to run out of storage. We look for the biggest files quickly or we get more storage, possibly one of the best SSDs. Although we have Ubuntu 20.04 installed, you can use a Raspberry Pi to run the instructions. The Terminal is used for all instruction actions. On most Linux computers, you can launch a terminal window if you are not at the command line. We have mentioned below the steps to find large files on Linux.
Steps to Find Large Files on Linux
Using the Find command to find the largest files in Linux
Any file on a Linux file system can be searched using the find command. We can use it in this situation to list files based on their file sizes. Results can also be filtered by minimum file size. Step 1: For find the biggest files inside your current working directory, type the following: Step 2: It is also possible add a filter with a minimum size of 100 MB. Step 3: For specify a particular directoryadd relative path after find command. Step 4: Doing so will find all the files inside the “test” with a size greater than 100 MB. Step 5: sometimes you need search the entire file system to find the largest file. To do this, just add a / after the find command. Step 6: For to remove this behavior and to check all mounted drives along with their primary filesystem, just remove the -xdev command as follows: Step 7: now you must be able to view the list of the largest files across your device along with your mounted drives.
Using the du command to find the biggest files in Linux
On Linux, the du command is primarily done for estimating file sizes. Here it is how to use it to find huge files. Step 1: You can use the -a flag to list files along with directory sizes recursively. Step 2: The file sizes listed here appear as very long number sequences, so they are very difficult to estimate. To make it readable use the -h flag in conjunction with other flags. Step 3: To make the file size uniform, use the -B block size operator along with a unit of your choice. If you want to convert sizes to MB, use M unit as block size. Step 4: To find the biggest files among them, use sort command to sort files in descending order. Step 5: To list only the first five results, channel sorted list in the head command using -n 5. Step 6: So far, we’ve only displayed file sizes in our current working directory. To list the largest files in a specific directory, append the directory name after the command du. The following command will list the five largest files in your home directory. Step 7: To find the top 10 files in your entire file system, just add the / after the du command.
Using the ls command to find the biggest files in Linux
One of the most fundamental commands in Linux, ls one is used to list the contents of a directory. The ls command can be used to sort files by size, date, or other criteria in addition to their basic alphabetical sort. ls -lSh /bin | head -5 Step 1: If you want to sort the result by file size, you can use the -lS option. This will show the files in a long list format and sort them by size. Step 2: If you want to see the human readable form of file sizes, you can use the -lhS option. This will show the files in a long list format and sort them by human readable file size. Step 3: If you want to see the reverse order of file sizes, you can use the -lrhS option. This will show the files in a long list format and sort them in reverse order of file size.
Final Words
We hope you like our article on how to find large files on Linux. You should frequently examine what Linux files and folders are using up more disk space. Finding superfluous items and removing them from your hard drive is absolutely necessary. Finding large files on your computer can help you for free up some much needed space quickly. Finding huge and unnecessary files may not be necessary for Linux desktop users. However, server capacity comes at a price and you must make monthly payments to use the extra space.