Skip to content

Filesystem information#

We can find out a lot about the filesystems on our system with a few commands. The mount command shows us what mounts we have on our system. We've seen this above.

There's also the df command, which means disk free and tells us how much free disk space we have: df

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
/$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        59G  1.5G   57G   3% /
devtmpfs        989M     0  989M   0% /dev
tmpfs           993M     0  993M   0% /dev/shm
tmpfs           199M  784K  198M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           993M     0  993M   0% /sys/fs/cgroup
tmpfs           199M     0  199M   0% /run/user/1000
/dev/loop0       97M   97M     0 100% /snap/core/9665
/dev/loop1       55M   55M     0 100% /snap/core18/1880
/dev/loop2       72M   72M     0 100% /snap/lxd/16100
/dev/loop3       29M   29M     0 100% /snap/amazon-ssm-agent/2012

I've used the -h flag to make the sizes "human readable", otherwise you get everything in bytes and it becomes difficult to read.

Our root filesystem at / has a maximum potential of 59G, as we can see above under the Size column. We've used 1.5G (or 3%) and as such, we have 57G available.

We can also see all of our virtual filesystems (the ones in memory) like devtmpfs. We can now also see their **total* sizes, with devtmpfs being 993M. This does not mean the filesystem using that much space, only that the filesystem's maximum size is 993M (in this case.)

We can also use the du command to see how much space a specific file or directory is using. Try this: cd /home && du -hs ./*

1
2
/home$ cd /home && du -hs ./*
32K ./ubuntu

So, my user, ubuntu, is only using a maximum of 32K of space on the entire system.