Could anybody explain to me how cd -
command work? man cd tells me that An argument of - is equivalent to $OLDPWD.
Then I found on the net that $OLDPWD is the previous working directory as set by the cd command. And when I do cd - on my unix I get -bash: cd: OLDPWD not set
which is confusing for me.
UPDATE: it works now it gives me the previous working directory. I guess I did not use and cd command before so that is why $OLDPWD was not set.
One more question what cd
(type cd and press enter) does? I wouldn't say that nothing. Is there any better technical explanation?
host [~]# cd
host [~]#