Skip to content

Instantly share code, notes, and snippets.

@michaelaye
Created March 11, 2014 04:00
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 michaelaye/9479299 to your computer and use it in GitHub Desktop.
Save michaelaye/9479299 to your computer and use it in GitHub Desktop.
print pretty path in a shell
#!/usr/bin/env python
import os
import pprint
path = os.environ['PATH']
path = path.split(':')
pprint.pprint(path)
@michaelaye
Copy link
Author

Put this into a file called printpath (or whatever you like), put it into $HOME/bin , add $HOME/bin to your PATH, then you can always call printpath to see your current path, looking like this:

$ printpath
['/u/paige/maye/anaconda/bin',
 '/u/paige/maye/bin',
 '/usr/lib64/qt-3.3/bin',
 '/usr/local/bin',
 '/bin',
 '/usr/bin',
 '/u/paige/maye/bin',
 '/usr/local/sbin',
 '/usr/sbin',
 '/sbin']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment