Skip to content

Instantly share code, notes, and snippets.

@rsbohn
Created August 16, 2026 11:24
Show Gist options
  • Select an option

  • Save rsbohn/dd3b6d8bbb3273dc6af31d0d1eb573d2 to your computer and use it in GitHub Desktop.

Select an option

Save rsbohn/dd3b6d8bbb3273dc6af31d0d1eb573d2 to your computer and use it in GitHub Desktop.
List mounted filesystems grouped by filesystem type
# APPS/UTIL/STORAGE
# List mounted filesystems grouped by filesystem type.
if ! command -v findmnt >/dev/null 2>&1; then
echo "findmnt not found"
exit 1
fi
findmnt -r -n -o FSTYPE,SOURCE,TARGET,OPTIONS |
sort -k1,1 -k3,3 |
awk '
BEGIN {
last = ""
printf "fstype:source:target\n"
}
{
fstype = $1
source = $2
target = $3
#printf " %-30s %-30s %s\n", source, target, options
printf "%s:%s:%s\n", fstype,source, target
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment