如何找出目录或文件所在的挂载/分区?(Linux 服务器)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3274354/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 20:16:05 来源:igfitidea点击:
How to find out mount/partition a directory or file is on? (Linux Server)
提问by ina
Is there a Linux command to easily find out which partition/mount a directory or file is on?
是否有 Linux 命令可以轻松找出目录或文件所在的分区/挂载?
(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..)
(这可能是一个 RTM 问题,我为问这个问题感到内疚,但不知何故,我还没有在谷歌上找到好的答案......)
采纳答案by Ignacio Vazquez-Abrams
df -P file/goes/here | tail -1 | cut -d' ' -f 1