Browse - Programming Tips - Linux: check if a filesystem is mounted

Date: 2019jul7
Language: bash

Q.  Linux: check if a filesystem is mounted

A.  Use the `mountpoint` command

MYFS=/mnt/myfs if mountpoint -q $MYFS; then echo $MYFS is mounted else echo $MYFS is not mounted fi
if -d $MYMFS; then ### WRONG fi