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.
Share
Categories
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
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 :-)
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 Permalink rate up rate down ReplyUnfortunately 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.
Umm... Is that a picture of quicklook running a slideshow on your iPhone? Do tell!
November 05 2007 at 3:32 PM Report abuse Permalink rate up rate down ReplyKamera & 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 Permalink rate up rate down ReplyThis is a great tip, thanks :)
November 05 2007 at 3:15 PM Report abuse Permalink rate up rate down ReplyGreat 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.
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 Permalink rate up rate down ReplyKamera: Its called being a programmer dude.
In the words of biggie, if you don't know, now you know ni**a.
why would somebody spend a "chunk of their day" in the terminal??
i'm honestly curious...
Hot Apps on TUAW
Deals of the Day
more deals- miFrame Picture Frame Dock for iPad for $64 + $8 s&h
- Refurb Apple iPod nano 8GB MP3 Player for $99 + free shipping, 16GB for $119
- Bling Diamond Snap-On Shell Case for iPhone 4 / 4S for $2 + $2 s&h
- Hannspree Apple-Shaped 28" 1080p LCD HDTV for $270 + free shipping
- Philips wOOx Alarm Clock Radio for Apple iPod / iPhone for $60 + free shipping
- iWatchz Elemetal Collection Bracelet for iPod nano for $75 + free shipping
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



10 Comments