PDF download Download Article
Use find, du, or a graphical app to discover your biggest files
PDF download Download Article

If you want to know which files on your Linux system are taking up the most space, you have several options, including both command-line and GUI tools. This wikiHow article will teach you the best ways to find large files on Linux.

Things You Should Know

  • To find large files on Linux, use this command: sudo du -aBm / 2>/dev/null | sort -nr | head -n 10
  • To find the largest files in a directory, use: du -ah /directory/name | sort -rn | head -n 10
  • To find all files over 500 MB, use: sudo find / -type f -size +500M -ls
Section 1 of 4:

Using the du Command

PDF download Download Article
  1. To see the top 10 largest files and their sizes in a directory, use du -ah /directory/name .
    • To find the largest files in the current directory, omit the directory name from the command.
    • You can replace -10 after head -n with your preferred number of large files to display.
  2. To see the ten largest files on your Linux system, use sudo du -aBm / 2>/dev/null .
    • Because you're finding the largest files in all directories, you'll need to use the sudo command to get root privileges.
    • This command can take a long time to run, as it needs to search all files on the system.
  3. Advertisement
Section 2 of 4:

Using the find Command

PDF download Download Article
  1. To find the 10 largest files in a directory, use find /directory/name -type f -exec ls -sh {} \; .
    • This command displays the ten largest files in the current directory and their sizes, with the largest file at the top of the list. You can replace 10 with your preferred number of files, such as 20 to see the 20 largest files.
    • To find the largest files in the current directory, omit the directory name or replace it with ..
  2. To find all large files above 500 MB in a directory, use find /directory/name -type f -size +500M.
    • Replace 500M with your preferred file size.
    • To search the current directory, replace the directory name with ..
  3. To find all files above a certain size on the entire filesystem, use sudo find / -type f -size +500M -ls. In this command, only files larger than 500 MB will appear in the results, along with their size, owner, and permissions.
  4. Advertisement
Section 4 of 4:

Using GUI Apps

PDF download Download Article
  1. This KDE app, which is available from Ubuntu Software (or use sudo apt install filelight at the prompt), makes it easy to find large files in Linux. It also displays the large files as a nice visual so you can get an idea of how your storage is being used.[1]
  2. Another great GUI tool that will help you find and visualize large files on Linux is QDirStat, which you can install using the command sudo apt install qdirstat (Debian, Linux Mint, and Ubuntu) or sudo dnf install qdirstat (Fedora and Redhat). Once installed, select any directory, including the root directory, to find large files.
  3. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

  • You can also use ncdu, a disk usage analyzer meant for finding large files on remote servers. Install it with sudo apt install ncdu, or get it from your distro's package manager.[2]
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

You Might Also Like

Install Google Chrome Using Terminal on Linux
Linux How to Mount Drive Mount Drives on Linux: Command Line & GUI
Can Linux Run ExeCan Linux Run .exe Files? How to Run Windows Software on Linux
Use Wine on Linux Install and Use Wine on Linux
Become Root in LinuxBecome Root in Linux
Take a Screenshot in LinuxTake a Screenshot in Linux
Tar a Directory Tar a Directory and Subdirectories in Linux
Execute INSTALL.sh Files in Linux Using Terminal Run an INSTALL.sh Script on Linux in 4 Easy Steps
Install DebianEasy Debian Linux Installation Tutorial
Run Files in LinuxRun Files in Linux
Boot Linux from a USB on Windows 10 Run Linus from a USB: Making a Bootable Stick and Installing
Add or Change the Default Gateway in LinuxAdd or Change the Default Gateway in Linux
Execute .RUN Files in LinuxExecute .RUN Files in Linux
Create an ISO File in LinuxCreate an ISO File in Linux
Advertisement

Expert Interview

Thanks for reading our article! If you’d like to learn more about linux, check out our in-depth interview with Michael Thompson-Brown.

About This Article

Michael Thompson-Brown
Co-authored by:
Cybersecurity Expert
This article was co-authored by Michael Thompson-Brown and by wikiHow staff writer, Nicole Levine, MFA. Michael Thompson-Brown is a Cybersecurity Expert based in Portland, Maine. He is the owner and founder of PCRescue!, a company that provides cybersecurity and data management solutions to small businesses and individuals. Michael has over 25 years of experience in the IT industry and is a certified ethical hacker. He is passionate about helping clients protect their data and systems from malicious attacks and helping them optimize their online presence and reach. He received a Master’s degree in Cybersecurity and Information Assurance from Western Governors University, and a Bachelor’s degree in Business Administration from the University of Phoenix. This article has been viewed 13,539 times.
How helpful is this?
Co-authors: 4
Updated: March 26, 2024
Views: 13,539
Categories: Linux
Thanks to all authors for creating a page that has been read 13,539 times.

Is this article up to date?

Advertisement