Open current directory in Finder

By Greg Goltsov

I often found myself getting frustrated of the same problem -- sometime, when in Terminal, I wanted to open the current directory I was in in Finder. I'm sure this sounds familiar.

Now, since I moved onto iTerm 2, there is an extremely handy shortcut for precisely that action: + Left click on the current folder name in your prompt. Works great, but what if you don't have iTerm?

Well, that's where the great xargs come in!

pwd | xargs open

This simple command pipes the current directory path to the open.

But can we do even better? Yes, actually.

open .

Now we can just alias this in .bashrc to something short and voilà!

alias 'lsf'='open .'

(lsf for ls in Finder)