Skip to content

Instantly share code, notes, and snippets.

@BBischof
Created July 26, 2016 17:57
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 BBischof/6ebfd978eaacee4916794a1e8f79f56c to your computer and use it in GitHub Desktop.
Save BBischof/6ebfd978eaacee4916794a1e8f79f56c to your computer and use it in GitHub Desktop.
navigate to the directory returned by a previous `which XXX`

usage:

>which spark-submit
path/to/spark/spark-submit

and then navigate to path/to/spark

>cd $(dirname $(!!))
#!/bin/bash
cd $(dirname $(!!))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment