Navigating through directories in the terminal can be a bit confusing, especially when you find yourself in a deep nested directory. If you ever find yourself in such a situation, you might want to go back to a previous directory. In this blog post, we’ll show you how to go back in directory in terminal.
One of the most common things that happen when using the terminal is navigating through directories. However, it can be frustrating when you have to go back all the way to your home directory or a previous directory. This is where the “cd” command comes in handy.
To go back one directory, you need to use the cd command with “dot dot”. When you use “cd” with “dot dot” (..), it takes you back to the previous directory. For instance, if you’re in the directory /cd/virtual machines/ubuntu/something and want to go back to the virtual machines directory, you can use “cd ..”. This will take you back to the virtual machines directory.
If you want to go back to the previous directory again, you can use “cd ..” again. This will take you back to the previous directory. You can continue using “cd ..” to go back as many directories as you want.
On Linux or Mac, you can use two dots instead of one. This means that you can use “cd ../..” to go back two directories. This shortcut can save you a lot of time and make your workflow more efficient.
In conclusion, knowing how to go back in directory in terminal is an essential skill for anyone using the terminal. Using the “cd” command with “dot dot” (..) or two dots (../..) can help you move around directories with ease. So, go ahead and practice navigating through directories and coming back to previous directories using these commands.