Monitoring disk space

In this recipe, we are going to show the commands that are used to monitor disk space.

How to do it...

We can use the df command with various switches to monitor disk space. To make the output more understandable, we often use the -h switch with the df command as follows:

bash-3.2$ df -h Filesystem size used avail capacity Mounted on 132G 80G 50G 62% / /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/mnttab swap 418G 488K 418G 1% /etc/svc/volatile swap 418G 38M 418G 1% /tmp swap 418G 152K 418G 1% /var/run /dev/dsk/c20t60000970000192602156533030374242d0s0 236G 240M 234G 1% /peterdata/cm_new /dev/dsk/c20t60000970000192602156533032353441d0s0 30G 30M 29G 1% /peterdata/native ...

Get PostgreSQL High Performance Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.