Created
September 17, 2019 23:36
-
-
Save tbielawa/742778bd915a7b34384646222f97cf06 to your computer and use it in GitHub Desktop.
Quick directory `cd`/shell hacks
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
# Make a named directory and change immediately into it | |
# | |
# pwd -> /tmp/cdhacks | |
# $ cdmkdir zerocool; pwd -> /tmp/cdhacks/zerocool | |
function cdmkdir () { | |
mkdir -p ${1} && cd ${1} | |
} | |
# Make a temp directory, add it to the top of the directory stack. | |
# Immediately switch into it. | |
# | |
# pwd -> /tmp/cdhacks/zerocool | |
# $ gotemp; pwd -> /tmp/tmp.ZMRBdB1L6r | |
# $ popd | |
# pwd = /tmp/cdhacks/zerocool | |
alias gotemp='pushd `mktemp -d`' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment