How to go back to previous directory in vs code terminal
- how to go back in terminal cd
- how to go back in terminal using cd
- how to go back after cd in terminal
- how to exit cd in terminal
How to go back to previous directory in terminal windows...
How To Go Back In Bash
Have you ever found yourself navigating through directories in the terminal and suddenly realized you need to go back to the previous directory?
Don’t worry, we’ve all been there!
How to go back to previous directory in ubuntu terminal
In this article, I’ll show you several ways to go back in Bash and make your command-line navigation a breeze.
Method 1: Using the ‘cd’ Command
The most basic and straightforward way to go back in Bash is by using the ‘cd’ command followed by the ‘..’ argument.
The ‘..’ argument refers to the parent directory of the current directory.
For example, let’s say you’re in the directory ‘/home/user/Documents’ and you want to go back to ‘/home/user’.
Simply type:
And voila! You’re now in the parent directory. You can continue using this method to go back multiple levels. For example, if you want to go back two levels from ‘/home/user/Documents’, you can type:
This will take you directly to ‘/home’.