How To Go Back To Previous Directory In Unix - 2 Answers Sorted by: 3 Bash utilizes a shell variable $OLDPWD which (as the name suggests) stores the old value of the present working directory $PWD. Also, the man page entry for Bourne shell built-ins has this to say about cd: An argument of - is equivalent to $OLDPWD. Which means that one could simply type $ cd - how to move back from a current directory Ask Question Asked 8 years 1 month ago Modified 8 years 1 month ago Viewed 4k times 0 Hi if suppose I am curently here cd Desktop kinectrobot src beginner tutorials src and after that working in src i want to move back one directory for example I want to go to beginner tutorials How do I do that
How To Go Back To Previous Directory In Unix

How To Go Back To Previous Directory In Unix
120 You can go back to the last dir with cd - Share Improve this answer Follow answered Apr 30, 2012 at 10:42 Darragh Enright 13.8k 7 42 48 1 Also, you can maintain a stack of diectories with dirs popd and pushd. More info here: talug.org/events/20030813/cmdline_tips_n_tricks_aug03.html – Darragh Enright Apr 30,. ;4 Answers Sorted by: 71 You can simply do cd - that will take you back to your previous location. Some shells let you use pushdir/popdir commands, check out this site. You may also find this SO question useful. Share Improve this answer Follow edited Mar 20, 2017 at 10:04 Community Bot 1 1 answered May 18, 2012 at 15:57 Levon 139k.
Command Line How To Move Back From A Current Directory Unix

How To Go Back To Previous Directory And Home Directory In Linux Shell Or Putty Techie Buzz
How To Go Back To Previous Directory In Unix;To cd to the previous directory, you can use one of the following commands in bash: cd - cd "$OLDPWD" To cd to your home directory, use one of: cd cd ~ cd "$HOME" 1 Does this answer your question What is the bash shortcut to change to the previous directory Peter Feb 28 2020 at 21 01 Add a comment 7 Answers Sorted by 411 You can use cd or you could use cd quot OLDPWD quot Share Improve this answer Follow edited Oct 16 2020 at 17 40 s 41 1k 15 71 114 answered Jun 30 2013 at 15 58 Raphael Ahrens
3 Answers Sorted by: 123 The shortcut is - Try cd - If you want to use this in your prompt, you have to refer to it with ~-. See the example: [echox@kaffeesatz ~]$ cd /tmp [echox@kaffeesatz tmp]$ ls cron.iddS32 serverauth.CfIgeXuvka [echox@kaffeesatz tmp]$ cd - /home/echox [echox@kaffeesatz ~]$ ls ~- cron.iddS32 serverauth.CfIgeXuvka Share Comando Rdiff backup No Linux Com Exemplos Acervo Lima How Do I Go Back To The First Directory In CMD Kembrel
Get Back To The Previous Location After cd Command

How To Go Back To A Directory In Linux
;1 $OLDPWD store (when it exists) the path to the old directory used. To write cd - is the equivalent (quicker) to write cd $OLDPWD. You can figure out as you can have a wider use of $OLDPWD when you want to move, e.g., some files from the present directory to the old one mv * $OLDPWD etc etc... – Hastur Sep 9, 2015 at 10:19 How To Go Back To A Directory In Linux
;1 $OLDPWD store (when it exists) the path to the old directory used. To write cd - is the equivalent (quicker) to write cd $OLDPWD. You can figure out as you can have a wider use of $OLDPWD when you want to move, e.g., some files from the present directory to the old one mv * $OLDPWD etc etc... – Hastur Sep 9, 2015 at 10:19 Cd CD CHDIR How To Go Back To A Directory In Linux

Concert Joseph Banks Compromite Cd Root Cruzerz

Powershell Previous Directory The 17 Correct Answer Brandiscrafts

How To Change Directory In Terminal On Ubuntu Linux Tutorials Learn Linux Configuration

The Files In The Current Directory They Can Use The Ls Command Systran Box

How To Go To Home Directory In Linux Using Cd Command Linux Tutorials Learn Linux Configuration

How To Use CMD To Delete Files And Folders On Windows 10 GeekFrost

Getting Started With Git For The Windows Developer Part II Get Acquainted With Bash John Atten

How To Go Back To A Directory In Linux

How To Go Back To A Directory In Linux

Bash Change Directory cd Methods Tips And Tricks Linux Tutorials Learn Linux Configuration