This is a command-line trick from a book-"The Productive Programmer":
pushd `which java`/..
The author says this command can temporarily go the directory where the executable command java lives.
When I typed this command in Linux, Bash complained that：
bash: pushd: /usr/bin/java/..: Not a directory
I also tried to change directory to
$ pushd /usr/bin/java/.. bash: pushd: /usr/bin/java/..: Not a directory
Why did I fail? Why cannot change to a directory using
/..? How to modify this command to fulfill the same task?