LSN #4 Storage and Device commands

I think everyone goes about viewing and modifying linux storage in there own way or they just forget, and use one of commands that all seem to blend together. Maybe its just me, but I always find df -h, lsblk & fdisk to blend together, so I thought writing a quick post about them would help me in the future.

Check the disk usage in human readable format with:

df -h

# High-level summary of directory sizes, including there contents.

du -hd1 . | sort -h

# List individual files and their sizes, breaking them down into seperate items.

du -ah . | sort -n -r | head -n 5

du -shc ./*

List all the hard drives and partitions with:

lsblk

A tool to manage disk partitions:

fdisk