== A Unix shell glob trick This is the kind of trick where first I show the trick and then I explain it: > $ touch a-b; mkdir a-c > $ cd a-* > sh: cd: a-b: Not a directory > $ cd a-*/ > $ pwd > /tmp/a-c (This is also a good illustration of quality of implementation in error handling. A number of non-bash Bourne shells will report things like '_cd: too many arguments_', while bash would happily work if _a-b_ happened to be a directory.) What this does is use a trick to pick the directory out of an otherwise ambiguous wildcard expansion. When there's a _/_ on the end, the shell will conveniently restrict the wildcard expansion to directories, or in the cases where I usually wind up using this, the directory. (The usual case for me is that I have just unpacked _foo-1.2.tar.gz_, creating _foo-1.2_, and now I want to _cd_ into the latter without having to type the full name (my [[usual shell ../sysadmin/NonstandardShellAdvantage]] doesn't have filename completion by default), but there are others that come up every so often.) Reading very carefully between the lines, I think that this behavior is required by the [[SUS ../links/SingleUnixSpecification]]. In general a shell might as well support this, since you can always write the wildcard as '_a-*/._' to force the issue. A closely related trick can be used to find all of the subdirectories in your current directory (or in general, somewhere): '_echo */._'. In theory '_echo */_' should be equivalent, but many shells seem to need the issue forced. I don't understand why those shells need this; that they behave differently for these two cases makes my head hurt. (Ironically, bash gets this one right, and I believe that getting it right is the [[SUS]]-required behavior.)