#!/bin/bash for dir in "$(cat /etc/mtab | grep encfs | awk '{print $2}' | sed -e 's/\040/ /g')" do echo "${dir}" | awk '{system("umount " $0)}' done