方法1:
if grep -qs '/mnt/foo' /proc/mounts; then
echo "It's mounted."
else
echo "It's not mounted."
fi
方法2:
if mountpoint -q /mnt/foo
then
echo "mounted"
else
echo "not mounted"
fi文档更新时间: 2021-11-12 02:51 作者:月影鹏鹏
访问 AIWALY 月影开源
方法1:
if grep -qs '/mnt/foo' /proc/mounts; then
echo "It's mounted."
else
echo "It's not mounted."
fi
方法2:
if mountpoint -q /mnt/foo
then
echo "mounted"
else
echo "not mounted"
fi