Skip to Content

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.



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,...
 

Add a Comment

*0 / 3000 Character Maximum

10 Comments

Filter by:
zolo

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 :-)

November 17 2007 at 11:14 PM Report abuse rate up rate down Reply
Max

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.

November 05 2007 at 6:48 PM Report abuse rate up rate down Reply
CyBeR

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.

November 05 2007 at 6:01 PM Report abuse rate up rate down Reply
Danny Zumwalt

Umm... Is that a picture of quicklook running a slideshow on your iPhone? Do tell!

November 05 2007 at 3:32 PM Report abuse rate up rate down Reply
wb

Kamera & Micah: not just being a programmer: try being a UNIX systems admin... I live in my terminal.

November 05 2007 at 3:25 PM Report abuse rate up rate down Reply
Joseph Crawford

This is a great tip, thanks :)

November 05 2007 at 3:15 PM Report abuse rate up rate down Reply
Andy Fowler

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.

November 05 2007 at 2:52 PM Report abuse rate up rate down Reply
Brian Reading

Great tip! I love how Apple makes things like Spotlight and Quick Look available from the Terminal. They're very useful when shell scripting!

November 05 2007 at 2:40 PM Report abuse rate up rate down Reply
Micah

Kamera: Its called being a programmer dude.
In the words of biggie, if you don't know, now you know ni**a.

November 05 2007 at 2:29 PM Report abuse rate up rate down Reply
kamera

why would somebody spend a "chunk of their day" in the terminal??

i'm honestly curious...

November 05 2007 at 2:14 PM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.