How to see the directory size in Linux with command line

In this Video we cover the du command. duĀ estimate’s the file space usage

First we look at the du mange page and then we cover some real world examples

Use du to list files size

du [file]

Make du human readable

du -h

Use du to list directory size (summarize)

du -sh /home

Use du to summarize directory’s under a parent

du -h –max-depth=1 /etc

Du one file system

du -sxh /mnt

Exclude files from du

du –exclude=’*.gz’

How to see file system disk usage from command line in Linux

In this video we cover the df command. DF reportsĀ file system disk space usage. DF differs from du because it looks at the file system and not files or directories.

We look at the man page for df and then we do some examples and what the output means

List disk usage on all file systems

df -a

Df human readable

df -h /

Use DF to check inodes

df -i

Show only local filesystems

df -hl