Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the mountpoint command in linux to determine whether the specified directory is the mount point

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail about the use of linux mountpoint command to determine whether the specified directory is a mount point, Xiaobian feel quite practical, so share with you as a reference, I hope you can read this article after harvest.

The mountpoint command is used to determine whether the specified directory is a mount point. If it is a mount point, it returns 0. If it is not, it returns non-0. Devices are always mounted in a specified directory, so you can use the mountpoint command to verify that a directory is "temporarily" occupied by the file system.

Syntax format: mountpoint [parameter] [directory]

Common parameters:

-q print no information-d print the primary and secondary device numbers of the file system-x print the primary and secondary device numbers of the block number device

Reference Example

Check if the/mnt directory is a mount point:

[root@linuxcool ~]# mountpoint /mnt/mnt is a mountpoint

Check if/usr/local is a mount point:

[root@linuxcool ~]# mountpoint /usr/local/usr/local is not a mountpoint

View the primary/secondary device numbers of the mounted/media/cdrom:

[root@linuxcool ~]# mountpoint -d /media/cdrom 11:0

To view a device's primary/secondary device number:

[root@linuxcool ~]# mountpoint -x /dev/sda 8:0 About using the mountpoint command in linux to determine whether the specified directory is a mount point, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report