Sunday, 4 September 2011

Take a quick look at files using Quick Look from the command line.

If you use OS X, you are probably familiar with quick look, a neat little tool to quickly preview files by hitting space when you have a file selected in Finder (alternatively, click the eye or use the menu). However, if you use the command line often, like me, you would like to be able to quicly view postscript, pdf or other files as well.

Add the following to your .bash_profile:

alias ql="qlmanage -p "$@" >& /dev/null"

qlmanage invokes Quick Look. It usually outputs some crap on the terminal, but if you add >& /dev/null, this is routed directly into oblivion.

So next time you want to quicly take a look at a file, you just hit ql file.x in the terminal to load it with Quick Look!

No comments:

Post a Comment