如何找出目录或文件所在的挂载/分区?(Linux 服务器) [英] How to find out mount/partition a directory or file is on? (Linux Server)

查看:33
本文介绍了如何找出目录或文件所在的挂载/分区?(Linux 服务器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有 Linux 命令可以轻松找出目录或文件所在的分区/挂载?

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

(这可能是一个 RTM 问题,我为问这个问题感到内疚,但不知何故,我目前还无法在 google 上找到好的答案..)

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

推荐答案

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

这篇关于如何找出目录或文件所在的挂载/分区?(Linux 服务器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆