Can someone explain :h as the article's description was not clear at all to me what was going on there.
Yeah, I couldn't make that work for me (on Linux or MacOS) .. although I'd love it if there were a way to quickly get 'just the directory' or 'just the filename' in bash with a shortcut, instead of having to resort to $(dirname blah) and so on .. I'm sure there is some way but :h doesn't look to be the shortcut as expected.
dirname => "${name%/*}"
basename => "${name##*/}"
Sadly you can't use it with !$ since it's not a variable. The closest you can do is: $ ls foo/bar/baz
ls: foo/bar/baz: No such file or directory
$ last=!$; echo "${last##*/}"
baz
$ echo "${last%/*}"
foo/bar