Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Files

Find Large Files

Submitted by on February 17, 2018 – 3:21 pm

Every time a filesystem is running out of space and I need to find something to delete, I end up googling the syntax for the find command to make sure it stays off NFS and doesn’t cross mountpoints. Finally, I decided to write this basic script.

Here’s the script. And a few examples on how to use it:

# 20 largest files in /opt/tomcat
large-files /opt/tomcat 20

# 12 largest files in each local filesystem
large-files 12

# 10 largest files in each local filesystem
large-files

Output fields:

DATE           Current date/time
HOST           Short hostname
KB             File size in KB
MTIME          File modification time
UID:GID        User/Group
RWX            Permissions
HL             Number of hardlinks
PATH           File path/name

 

Print Friendly, PDF & Email

Leave a Reply