Skip to content

Instantly share code, notes, and snippets.

@AlD
Created August 25, 2012 11:45
Show Gist options
  • Save AlD/3464296 to your computer and use it in GitHub Desktop.
Save AlD/3464296 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -u
basepath="${1:-/}"
read device rest < <(df -P "$basepath" | grep ^/)
mount | grep "^${device} " | while read dev on mountpoint rest; do
[[ "$mountpoint" != "${basepath}" ]] && echo "$mountpoint"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment