I often find that, when I'm confronted with a filesystem access failure, during that lovely "wtf?" moment, I often mutter (and type) pathlld
(a bash
script)
$ pathlld -h
pathlld [-f] [-h] [-l] [-m] <file> ...
pathlld: Use /bin/ls -ld to show permissions and ownerships for
pathlld: each directory in the path for <file>.
pathlld: -f Process nonexistent <file>s, to
pathlld: see existing parts of path to <file>.
pathlld: -l If a path component is a soft-link, do /bin/ls -Lld, too.
pathlld: -m Show mount info for any path component.
pathlld: that is a mountpoint.
pathlld: -v Turn on verbose output to STDERR.
pathlld: -h This help.
E.g.,
$ pathlld -m -l $(type -p vim)
drwxr-xr-x 27 root root 4096 Aug 21 20:03 /
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
drwxr-xr-x 14 root root 4096 Jan 4 2015 /usr
drwxr-xr-x 3 root root 151552 Aug 25 10:08 /usr/bin
lrwxrwxrwx 1 root root 21 Jan 23 2013 /usr/bin/vim -> /etc/alternatives/vim
-rwxr-xr-x 1 root root 2580984 Jan 2 2014 /usr/bin/vim
$ pathlld -m -l mnt/CLIPZIP/PODCASTS/
drwx------ 11 w3 walt 4096 May 21 00:21 mnt
drwxr-xr-x 12 w3 walt 32768 Dec 31 1969 mnt/CLIPZIP
/dev/sdb on /home/w3/mnt/CLIPZIP type vfat (rw,noexec,nosuid,nodev,uid=1003,gid=1000)
drwxr-xr-x 37 w3 walt 32768 Aug 25 14:07 mnt/CLIPZIP/PODCASTS
I would like to publish this tool. Can I do it via AskUbuntu?
I finally published it via github!
GitHub repositories:
https://github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"
https://github.com/waltinator/net-o-matic.git - Watch for (WiFi) network going down, then do a user-specified thing to fix it.