Is there any single command to see the file/directory permissions of all the intermediate directories of a path?
You can run this code :
lsd() { local v="$1"; while :; do v="${v%/*}"; [[ "$v" && ! -f "$v" ]] || break; ls -ld "$v"; done; }
lsd /usr/share/doc/acl/README
drwxr-xr-x 2 root root 4096 14 mai 12:28 /usr/share/doc/acl/
drwxr-xr-x 145 root root 4096 4 nov. 06:23 /usr/share/doc/
drwxr-xr-x 263 root root 12288 4 nov. 06:23 /usr/share/
drwxr-xr-x 14 root root 4096 28 oct. 22:47 /usr/
Edit: added local keyword
Edit2: The last item error is resolved
Here is a simple while-loop which does the job:
f="$PWD"
while [ "$f" != "/" ]
do
ls -ld "$f"
f=$(dirname "$f")
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With