Rodrigo Martell

Opening a directory with PathFinder from the Terminal

Adding an alias to your zshrc file allows you to use the wrap terminal's -open- command to make a -pf- (PathFinder) command.

For a few years I've been using Cocoatech's PathFinder app as a replacement for OSX's Finder app, which falls short at times for my needs.

I initially started using PathFinder in the pre-Mavericks days for tabbed and split-window file browsing. It rocked and I have since come to love some of its many features I occasionally use like batch renaming of files, built-in terminal, and checksum calculation.

I often, however am working from a zsh terminal and need to open a directory to do something to it. To open it with Finder I would do the following:

# Open current directory in Finder
$ open ./

It would be cool if I could do the same with PathFinder. While PathFinder doesn't have a cli (AFAIK), it was easy to extend the idea above by adding this to my zsh config file (in ~/.zshrc):

#-> This allows one to open a path in PathFinder app
alias pf="open -a \"Path Finder.app\""

And use like so:

$ pf ./

I don't know why it took me so long to realise this could be done, but glad I did now. pf now complements other quick access commands I'm already fond of like:

$ stree ./ # Opens git repo in source tree app
$ subl ./  # Opens directory in SublimeText

Simple pleasures, I know. When you do this often, however, it feels good to have saved a few seconds in extra effort.

comments powered by Disqus