Skip to content

Instantly share code, notes, and snippets.

@pbrisbin
Created October 20, 2010 00:58
Show Gist options
  • Select an option

  • Save pbrisbin/635554 to your computer and use it in GitHub Desktop.

Select an option

Save pbrisbin/635554 to your computer and use it in GitHub Desktop.
# go to a directory or file's parent
goto() { [[ -d "$1" ]] && cd "$1" || cd "$(dirname "$1")"; }
# copy and follow
cpf() { cp "$@" && goto "$_"; }
# move and follow
mvf() { mv "$@" && goto "$_"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment