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 Folders

Submitted by on January 9, 2019 – 4:37 pm

When you get a filesystem space alert (and they tend to arrive at 3:37 on Saturday morning), deleting various supersized log files is one option I already covered in adequate detail. That is if you get so lucky as to find such a file to delete…

On occasion, the out-of-space situation is like a death by a thousand paper cuts – folders filled with a large number of small files. This little script here fill look for folders matching “log(s)” or “t(e)mp” that are greater than 200MB in size (you can easily adjust these parameters).

To install:

d=/var/adm/bin
f=large_folders.sh
mkdir -p ${d}
wget --no-check-certificate -O ${d}/${f} https://raw.githubusercontent.com/igoros777/kw/master/large_folders.sh
chmod 755 ${d}/${f}
ln -s ${d}/${f} /usr/bin/large-folders

The syntax is simple:

large-files [directory] [number of entries to display]

If you don’t specify the directory name, the script will search all mounted local filesystems.

Print Friendly, PDF & Email

Leave a Reply