News for hackers. Stuff that matters.
Re:OS X Command Line Utilities by ggreer on Thursday May 15, 2014 @04:10AM (#7748319)
Many people love them, but I never got the hang of pushd and popd. These days, I use a CDPATH and z[1]. I also use zsh, which supports handy little things such as cd - (cd to previous directory).

If you haven't tried it, I highly recommend z. It's impossible to Google for, but it's oh-so-convenient.

1. https://github.com/rupa/z

Re:OS X Command Line Utilities by bronson on Thursday May 15, 2014 @04:15AM (#7748329)
'cd -' is implemented by the cd command using the OLDPWD environment variable. It works in all shells.
Re:OS X Command Line Utilities by ggreer on Thursday May 15, 2014 @04:31AM (#7748370)
I did some digging and it turns out I had autopushd set. No wonder I didn't understand the usefulness of pushd/popd; I was already using them.

Also, by "cd -" I meant cd -[tab], cd -1, cd -2, etc.

Re:OS X Command Line Utilities by mokkol on Thursday May 15, 2014 @07:57AM (#7748900)
Thanks! didnt know the tab feature.
Re:OS X Command Line Utilities by zwegner on Thursday May 15, 2014 @04:56AM (#7748433)
cd is a shell built-in, not an external command. It has to be, since it changes the directory of the shell process, which can't be done by a child process. So shells do have to implement this specially.
Re:OS X Command Line Utilities by jdkenney on Thursday May 15, 2014 @01:28PM (#7750883)
Since no one has mentioned it and it would seem to be not well known, you can also cd to previous directory in bash:

cd ~-