Eu uso meu script pathlld
. pathlld
é:
#!/bin/bash
# Show the permissions on all the directories leading from / to
# the parameter.
# Usage: $0 <file_or_dir> <...>
#
# $Header: /home/walt/bin/RCS/pathlld,v 1.4 2010/02/21 20:34:16 walt Exp $
#
#
function pathlld ()
{
if [ "$1" = "/" ] ; then
/bin/ls -ld /
else
parent="${1%/*}"
pathlld "${parent:-/}"
/bin/ls -ld "$1"
fi
}
force=0
if [ "$1" = "-f" ] ; then
force=1
shift
fi
# Make sure we got at least one filename or directory name
file_or_dir="$1"
file_or_dir="${file_or_dir:?'missing.'}"
while [ $# -ne 0 ] ; do
if [ $force -eq 1 -o -e "$1" ] ; then
case "$1" in
/* ) target="$1" ;;
* ) target="$PWD/$1" ;;
esac
pathlld "$target"
[ -L "$target" ] && /bin/ls -ldL "$target"
else
echo "Nonexistent file or directory: $1"
fi
shift
done
Ele não detecta sistemas de arquivos montados como somente leitura, use mount
para isso.