How to find out mount/partition a directory or file is on? (Linux Server)

ina picture ina · Jul 18, 2010 · Viewed 97.1k times · Source

Is there a Linux command to easily find out which partition/mount a directory or file is on?

(This is probably a RTM question, and I feel guilty for asking it, but somehow, I can't find a good answer on google just yet..)

Answer

Ignacio Vazquez-Abrams picture Ignacio Vazquez-Abrams · Jul 18, 2010
df -P file/goes/here | tail -1 | cut -d' ' -f 1