Linux – Find out which partition a directory is located on in Linux

bashlinux

Is there a way to find out which partition a directory is located in?

I know I can use df to list partitions and mount points but I need to be able to find out which partition any directory is located in with a simple command.

Best Answer

df -h .

gives you:

$ df -h .
Filesystem     Size   Used  Avail Capacity  Mounted on
/dev/disk0s2  1.4Ti  390Gi  1.0Ti    28%    /

so you have 'mounted on' for that dir