Show disk usage two levels deep

Show the 20 biggest directories in /var, up to 2 levels deep.

du -h --max-depth=2 /var | sort -rh | head -20

tool
linux133 commands
tags
linuxdisk

More linux commands

  • df -hT --type=ext4 --type=xfs --type=btrfs

    Show free space only for real filesystems (ext4, xfs, btrfs), without tmpfs and overlay.

  • fdisk /dev/sdb

    Open an interactive editor for MBR or GPT partition tables.

  • parted /dev/sdb -- mklabel gpt mkpart primary ext4 1MiB 100%

    Create a new GPT table and one partition on the whole disk. The old partition table is lost.

  • pvs && pvdisplay

    List LVM physical volumes and how much space they use.

  • vgs && vgdisplay

    List LVM volume groups with free physical extents (PE).

all 133 linux commands