mountpoint – see if a directory is a mountpoint

commandline session

$mountpoint
Usage: mountpoint [-q] [-d] [-x] path
$mountpoint /
/ is a mountpoint
$mountpoint /var
/var is not a mountpoint
$mountpoint /usr
/usr is not a mountpoint
$mountpoint -x /dev/sda1
8:1
$mountpoint -x /dev/sda2
8:2
$mountpoint -x proc
mountpoint: proc: No such file or directory
$mountpoint -x /proc/
mountpoint: /proc/: not a block device
$mountpoint  /proc/
/proc/ is a mountpoint
$mountpoint  tmpfs
mountpoint: tmpfs: No such file or directory
$mountpoint  -x tmpfs
mountpoint: tmpfs: No such file or directory
$mountpoint  /run/shm/
/run/shm/ is a mountpoint
$mountpoint  /run/
/run/ is a mountpoint
$mountpoint  /dev/
/dev/ is a mountpoint
$

inner working

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s