Linux is a Unix-like operating system that 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.
We all know that we run out of storage space eventually, but on Ubuntu 20.04, there are ways to find large files quickly. One way is to use a Raspberry Pi as a terminal emulator. Another way is to use the Terminal. The Terminal is used for all instruction actions on most Linux computers.
Steps to Find Large Files on Linux
Using the Find command to find the largest files in Linux
Find files on a Linux file system using the find command. We can use it to list files based on their file sizes and to filter results by minimum file size.
ls -l Step 2: To find the biggest files in your current directory, type the following: ls -lah ..
To add a filter with a minimum size of 100 MB, follow these steps: ..
Find “C:\Users<username>\AppData\Roaming\Microsoft\Windows\CurrentVersion” -name “My Documents” -path C:\Users<username>\AppData\Roaming Step 4: For specify a particular file add absolute path after find command. Find “C:\Users<username>\AppData\Roaming.minecraft” -name “My Documents” -path C:\Users<username>\AppData\Roaming.minecraft
To find all the files inside the “test” folder that are larger than 100 MB, do the following: ..
To find the largest file on your system, you can use the find command with a “/” after it. This will search the entire file system for the largest file. ..
sudo -xdev Step 6: To remove this behavior and to check all mounted drives along with their primary filesystem, just remove the -xdev command. ..
To view the list of the largest files on your device, open “File Explorer” and navigate to “My Computer” (or “Computer”). Underneath each mounted drive, you’ll see a list of the largest files on that drive. ..
Using the du command to find the biggest files in Linux
The du command is used to find huge files on Linux. It can be used to estimate the size of a file based on its contents.
Step 2: The -h flag will show you the help for the command. Step 3: The -c flag will create a new directory. ..
The file sizes listed here appear as long number sequences, so they are difficult to estimate. To make it readable use the -h flag in conjunction with other flags.
-B block size: This sets the block size to be the same as the file’s size. -M unit: This sets the block size to be the same as the maximum memory that your computer can handle.
To find the biggest files among them, use sort command to sort files in descending order.
- Sort the results by name
- Channel sorted list in the head command using -n 5
du -sh The five largest files in your home directory are: /home/username/Desktop/file.txt /home/username/Desktop/document.pdf /home/username/.local/.gitignore ./configure.ac ..
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
The ls command can be 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.
Step 2: If you want to sort the result by date, you can use the -dS option. This will show the files in a date-based list format and sort them by date.
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. ..
-lrhS
Final Words
If you want to free up disk space on your computer, it is important to regularly examine what files and folders are using up the most space. This can help you determine which files are unnecessary and can be removed from your hard drive. Additionally, if you are a Linux desktop user, it is recommended that you try to find large files that are not necessary for your use. However, for server users, paying for extra storage space may be necessary.