bangrot.blogg.se

Windows terminal commands how to move up one directory
Windows terminal commands how to move up one directory










This is just one of a handful of essential change directory (AKA cd) command tricks that Terminal users should know, don’t miss these other essential ‘cd’ command tips too. It also works regardless of how deep into a directory structure you are or were, so you can seamlessly toggle your place in the file system with cd – try it out yourself, you’ll be thrilled with the result.

WINDOWS TERMINAL COMMANDS HOW TO MOVE UP ONE DIRECTORY MAC OS X

This command line tip works in every variant of Unix I’ve used, so whether you’re in the Mac OS X command line (which is based on BSD) or Linux, you should be covered. On UNIX systems, you can use the (tilde) character to represent the user home folder. This is not only helpful if you lost your place somewhere accidentally while at the command line, but it’s also very useful if you are working in two different directories and you want to quickly go back and forth between them, just keep typing cd – and you will keep switching between the two directories! You can think of cd – as kind of like a back button for the command line, it will instantly jump back to the previously current directory.

windows terminal commands how to move up one directory

Now just type cd – to switch back to the prior location, and cd – again to switch back to the original location.

windows terminal commands how to move up one directory

You can try it out yourself by opening a Terminal window, navigating somewhere within the file system, then immediately switching directories to another location.

windows terminal commands how to move up one directory

It’s that simple, cd – will take you to the directory you were in prior to the PWD (Present Working Directory), and it will print out the prior directory as well so you will know you’re in the right place.










Windows terminal commands how to move up one directory