LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Help Please!! -- need to find command that will switch you back to your previous CWD (https://www.linuxquestions.org/questions/linux-general-1/help-please-need-to-find-command-that-will-switch-you-back-to-your-previous-cwd-642527/)

Tron55555 05-15-2008 10:03 PM

Help Please!! -- need to find command that will switch you back to your previous CWD
 
Hello. Can anyone tell me what the command is to switch back to your previous current working directory? Any help is greatly appreciated. Thanks!

-- Tron

rlhartmann 05-15-2008 10:11 PM

cd - # add the dash after a space,

the previous directory is also stored in a variable
called OLDPWD so

cd $OLDPWD would also work, or you could copy files from
your new directory to the old using something like

cp filea $OLDPWD

Tron55555 05-15-2008 10:35 PM

Thank you!
 
Yes, exactly what I was look for (cd -).

Thanks alot -- I've got a test tomorrow morning and that question was asked on the study sheet, but I couldn't find it anywhere in my text book, so your help is greatly appreciated. Thanks again.

-- Tron


All times are GMT -5. The time now is 08:34 PM.