Skip to content

Instantly share code, notes, and snippets.

@msridhar
Created August 24, 2013 23:34
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 msridhar/6331017 to your computer and use it in GitHub Desktop.
Save msridhar/6331017 to your computer and use it in GitHub Desktop.
Aliases for a command cpth that, given a relative path to a file, gets the absolute path and copies it to the Mac clipboard
alias realpath="python -c \"import os,sys; print os.path.realpath(sys.argv[1])\""
alias mypbcopy="tr -d '\n' | pbcopy"
function cpth {
realpath $1 | mypbcopy
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment