命令
mountpoint
描述
see if a directory is a mountpoint
检查目录是否为挂载点
用法
1 2
| mountpoint [-qd] /path/to/directory mountpoint -x /dev/device
|
选项
1 2 3 4
| Options: -q, --quiet 静默模式 -d, --fs-devno 显示文件系统的设备号maj:min -x, --devno 显示块设备的设备号maj:min
|
注意
无
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| $ mountpoint /mnt/temp/ /mnt/temp/ is a mountpoint $ mountpoint /mnt /mnt is not a mountpoint $ mountpoint / / is a mountpoint
$ mountpoint -q /mnt $ echo $? 1 $ mountpoint -q /mnt/temp/ $ echo $? 0
$ mountpoint -d /mnt/temp/ 8:17 $ lsblk /dev/sdb1 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb1 8:17 0 5G 0 part /mnt/temp
$ mountpoint -x /dev/sdb 8:16 $ mountpoint -x /dev/sdb1 8:17 $ lsblk /dev/sdb* NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 10G 0 disk └─sdb1 8:17 0 5G 0 part /mnt/temp sdb1 8:17 0 5G 0 part /mnt/temp
|