Filed under: Cool tools, Terminal Tips, Leopard
Terminal Tip: Use Quick Look from the Leopard command line
TUAW reader Shaun Haber sent us a link to his personal blog with a great post about using Leopard's Quick Look from the command line, which is wonderfully handy for anyone who spends a chunk of their day in Terminal. The qlmanage utility gives you direct access to many Quick Look functions; of specific interest is the -p flag. This option displays the Quick Look generated preview for any file. So if you tell it to qlmanage -p foo.png, the image immediately pops up in a Quick Look pane.
Even better, Quick Look supports slide shows. So if you cd into a folder of images and run qlmanage -p *.jpg, you'll be rewarded with a full-on presentation of your pictures.
Other qlmanage flags of interest include -h (displays a help message) -t (thumbnail generation) and -f (a zoom factor to display with).
The downside of qlmanage is that it's full of NSLog-style messages. Haber recommends you pipe the output into /dev/null as follows: qlmanage -p *.jpg >& /dev/null.
Get a WordPress.com Blog
![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
kamera said 2:14PM on 11-05-2007
why would somebody spend a "chunk of their day" in the terminal??
i'm honestly curious...
Reply
Micah said 2:30PM on 11-05-2007
Kamera: Its called being a programmer dude.
In the words of biggie, if you don't know, now you know ni**a.
Reply
Brian Reading said 2:41PM on 11-05-2007
Great tip! I love how Apple makes things like Spotlight and Quick Look available from the Terminal. They're very useful when shell scripting!
Reply
Andy Fowler said 2:53PM on 11-05-2007
Great tip! For an even easier way to access Quick Look from Terminal, add this to your /etc/bashrc file:
function ql()
{
qlmanage -p “$@” > /dev/null 2>&1
}
Now all you need to do is type in `ql *.jpg` to preview all JPGs. This hides all of the output text of the command, so you don't ruin your scrollback.
Reply
Joseph Crawford said 3:16PM on 11-05-2007
This is a great tip, thanks :)
Reply
wb said 3:25PM on 11-05-2007
Kamera & Micah: not just being a programmer: try being a UNIX systems admin... I live in my terminal.
Reply
Danny Zumwalt said 3:32PM on 11-05-2007
Umm... Is that a picture of quicklook running a slideshow on your iPhone? Do tell!
Reply
CyBeR said 6:01PM on 11-05-2007
Unfortunately it doesn't seem to support full-screen in this way, though.
#7: No, I'd say it's a picture of an iPhone screenshot.
Reply
Max said 6:48PM on 11-05-2007
For some reason, this only shows reduced-size images in quicklook. they're shown with the filename and info on the right, and the small image on the left. Not the same as just selecting the images and hitting Space.
Reply
zolo said 11:15PM on 11-17-2007
Maybe a bit easier to add to ~/.profile or ~/.bash_profile as an alias as follows -- alias ql='qlmanage -p “$@” > /dev/null 2>&1'
You can type "ql *.jpg" and get the same results as above.
Making another "chunk of my day @ the terminal" more enjoyable :-)
Reply