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
Linux – How to check the exit status of several piped commands
Viewed 3676 times since Wed, Jul 25, 2018
Using etckeeper with git
Viewed 8083 times since Sun, Jun 3, 2018
Using stunnel to Encrypt Database Connections
Viewed 6039 times since Fri, Sep 28, 2018
CentOS / RHEL 7 : Configuring an NFS server and NFS client Linux NFS
Viewed 18196 times since Fri, Feb 21, 2020
Open SSL Encrypt & Decrypt Files With Password Using OpenSSL
Viewed 10090 times since Mon, Feb 18, 2019
Exclude multiple files and directories with rsync
Viewed 3273 times since Wed, Oct 31, 2018
LUKS List available methods of encryption for LUKS
Viewed 3730 times since Fri, Jul 13, 2018
RHEL: Rebuilding the initial ramdisk image
Viewed 9094 times since Sat, Jun 2, 2018
RHEL: Extending the maximum inode count on a ext2/ext3/ext4 filesystem
Viewed 4462 times since Sun, May 27, 2018
logrotate - rotates, compresses, and mails system logs.
Viewed 2573 times since Fri, Nov 30, 2018