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

LinuxFileDirectoryMountDisk Partitioning

Linux Problem Overview


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..)

Linux Solutions


Solution 1 - Linux

df -P file/goes/here | tail -1 | cut -d' ' -f 1

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioninaView Question on Stackoverflow
Solution 1 - LinuxIgnacio Vazquez-AbramsView Answer on Stackoverflow