Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bronson
on May 15, 2014
|
parent
|
context
|
favorite
| on:
OS X Command Line Utilities
'cd -' is implemented by the cd command using the OLDPWD environment variable. It works in all shells.
ggreer
on May 15, 2014
|
next
[–]
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.
mokkol
on May 15, 2014
|
parent
|
next
[–]
Thanks! didnt know the tab feature.
zwegner
on May 15, 2014
|
prev
[–]
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: