-
-
Save wetherc/4d346cd2f85a34ffbe5162b9b31cd5d6 to your computer and use it in GitHub Desktop.
Pushd / Popd example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do some work in my home directory | |
chriss-MacBook-Pro:~ chris$ pwd | |
/Users/chris | |
chriss-MacBook-Pro:~ chris$ vim myAwesomeCode.py | |
chriss-MacBook-Pro:~ chris$ python myAwesomeCode.py | |
# Switch directories real quick | |
chriss-MacBook-Pro:~ chris$ cd /etc | |
chriss-MacBook-Pro:etc chris$ vim hosts | |
# Go back to my original directory | |
# IMPORTANT: Here, I need to remember | |
# and explicitly specify what my | |
# previous directory was | |
chriss-MacBook-Pro:etc chris$ cd /Users/chris | |
chriss-MacBook-Pro:~ chris$ python myAwesomeCode.py | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do some work in my home directory | |
chriss-MacBook-Pro:~ chris$ pwd | |
/Users/chris | |
chriss-MacBook-Pro:~ chris$ vim myAwesomeCode.py | |
chriss-MacBook-Pro:~ chris$ python myAwesomeCode.py | |
# Switch directories real quick | |
chriss-MacBook-Pro:~ chris$ pushd /etc | |
/etc ~ | |
chriss-MacBook-Pro:etc chris$ vim hosts | |
# Go back to my original directory | |
# IMPORTANT: I don't need to know what | |
# directory I had open before this! | |
chriss-MacBook-Pro:etc chris$ popd | |
~ | |
chriss-MacBook-Pro:~ chris$ python myAwesomeCode.py | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment