Pier One Imports has chair and table named after me. They even spelled my name right! This is amazing because I can never find personal branded shit that has my name spelled correctly.
Archive for November, 2007
For all you Leopard users out there, here’s a handy trick to use Quick Look from the command line.
Leopard ships with a command called ‘qlmanage’. The -p option shows a preview of the file passed to the command. In the terminal, type the following:
qlmanage -p thefile
You can extend this by creating the following shell script:
#!/bin/bash
qlmanage -p $1 >& /dev/null &
The >& /dev/null prevents output from displaying, and the & runs the process in the background so a new prompt displays on the terminal.
Save this script as an executable file and store it somewhere in your PATH. I recommend naming it something short like ‘ql’.
(Note: I stored mine in a home bin folder used for custom-made scripts).
You can close the Quick Look window with the mouse (the conventional way), or close it in the terminal by getting the pid from the ps command and using kill [pid].
Using the ql command in Terminal
Closing the Quick Look window using the kill command
This feature is really handy for me because I spend a lot time in the Terminal. Many times I encounter a file such as an image, pdf, word doc, etc. that I’d like to briefly preview.
Before I discovered this, I would resort to opening Finder and navigating to the same directory to preview the file. Being able to do this all from Terminal is a real time saver!
[UPDATE]
A better solution is to use “$@” (with quotes) instead of $1 in the script. This will allow multiple arguments and wrap quotes around each one to account for spaces or other odd characters in the filename. Additionally, providing multiple arguments creates a slideshow in Quicklook.
#!/bin/bash
qlmanage -p “$@” >& /dev/null &



Shaun Haber