方法1:

  1. if grep -qs '/mnt/foo' /proc/mounts; then
  2. echo "It's mounted."
  3. else
  4. echo "It's not mounted."
  5. fi

方法2:

  1. if mountpoint -q /mnt/foo
  2. then
  3. echo "mounted"
  4. else
  5. echo "not mounted"
  6. fi

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2021-04-11
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
猜你喜欢
  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2021-10-11
相关资源
相似解决方案