Skip to content

Instantly share code, notes, and snippets.

@darthlukan
Created May 3, 2017 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darthlukan/0af0152749d67b88422e3e768bb2e732 to your computer and use it in GitHub Desktop.
Save darthlukan/0af0152749d67b88422e3e768bb2e732 to your computer and use it in GitHub Desktop.
Shell change directory
## script.sh
#!/bin/sh
$DESIRED_DIR="~/foo"
cd $DESIRED_DIR
## END script.sh
## .bashrc || .zshrc || .profile || .zprofile
alias mycd=". ~/bin/script.sh"
## END .*rc
## In shell
$ pwd
>> ~/
$ mycd
$ pwd
>> ~/foo
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment