SHARE
Facebook X Pinterest WhatsApp

A Shell Script to Monitor Disk Usage and Send an Alert if it Exceeds 80%

Written By
T
TecMint
Oct 2, 2025

If you’ve ever run a Linux system in production or even just kept a personal server, you’ll know that running out of disk space is one of the most frustrating issues. Suddenly, your applications stop working, databases won’t write new data, and log files keep filling up like a runaway train.

The good news is that Linux makes it surprisingly easy to monitor disk usage and catch problems before they happen. All you need is a small shell script, a bit of logic, and maybe an email alert (or a message to your Slack channel, if you’re fancy).

In this article, we’ll build a simple script that checks your disk usage and sends an alert if it goes over 80%.

T

TecMint

Recommended for you...

KDE Gear 25.08.3 Is Out with More Bug Fixes, KDE Gear 25.12 Coming December 11th
Marcus Nestor
Nov 18, 2025
Linux Mint Devs Introduce New System Administration & System Information Tools
Marcus Nestor
Nov 18, 2025
Calibre 8.14 Open-Source E-Book Manager Updates the Tolino Driver and Fixes Bugs
Marcus Nestor
Nov 18, 2025
How to Install MongoDB on Debian 13
RoseHosting Blog
Nov 18, 2025
Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.