Jump to content

disk free space


Pic0o

Recommended Posts

Check for disk free space on Linux. I forget my df and du flags so often when I want to recall them, so a thread for my usages.

 

df I think of as disk free.  This will check the volume.

 

du I think of as disk used.  Filtering output with this will give details on specific files as you widdle your free space down.  Ubuntu based terminal implied for most syntax, as container wranglers know we getting more shells than bash with the extra trim.
Be ready to drop some flags if container hopping in a docker and or kubernetes environment.\

 

du -a / | sort -n -r | head -n 20

 

df -h

for your volume basic needs. A little more filtered example below as handy if triaging a host computer needing free space back.

du -ah /var/lib/docker/containers | sort -n -r | head -n 20

 

Link to comment
×
×
  • Create New...