I am learning some elements of the Unix environment myself. I have tried to search up this question but perhaps I am not wording it correctly. It is quite possibly a very trivial question, too, but I am just not sure how to do it.
On terminal on my Mac, I know that I can do cd /
to access my Unix directory files on terminal. However, how can I exit out of /
and return to the previous directory I was in? I have tried cd ..
but that does not work (why not? I don't know). I also don't want to use cd -
because it is not necessary that my prior directory is the desired one.
cd ..
go to upper directory, not previous one. And as/
is the root you can't go in upper one.cd
should take you to your home directory (usually/home/<username>
)cd -
, but OP doesn't want that for some reason. It is VERY unclear where OP actually wants to go. He wants the "previous directory", which is somehow not necessarily the "prior directory".