How to find the largest files and directories in Linux?

How to find the largest files and directories in Linux?

Answer:

For example, to list out top 10 files and directories inside /opt, you can use the following command:

# du -a /opt| sort -nr | head -n 10

Attachments
There are no attachments for this article.
Related Articles RSS Feed
Set Up SSH Tunneling on a Linux / Unix / BSD Server To Bypass NAT
Viewed 11879 times since Fri, May 15, 2020
How to run command or code in parallel in bash shell under Linux or Unix
Viewed 3882 times since Tue, Aug 6, 2019
RHEL: udev rules basics
Viewed 10207 times since Sat, Jun 2, 2018
How to enable Proxy Settings for Yum Command on RHEL / CentOS Servers
Viewed 13821 times since Thu, Jul 19, 2018
How log rotation works with logrotate
Viewed 5515 times since Fri, Nov 30, 2018
Check a Website Availability from the Linux Command Line
Viewed 7353 times since Mon, Feb 18, 2019
Fake A Hollywood Hacker Screen in Linux Terminal linux FUN
Viewed 7403 times since Thu, Apr 18, 2019
6 rsync Examples to Exclude Multiple Files and Directories using exclude-from
Viewed 5905 times since Wed, Oct 31, 2018
How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 3282 times since Wed, Oct 17, 2018
RHEL: Resize/disable /dev/shm filesystem
Viewed 16110 times since Sun, May 27, 2018