How to use Quick Look from Terminal in macOS
[ad_1]
Quick Look is one of the more compelling features in macOS. Introduced in OS X 10.5, you no longer do you have to open an application just to glance at a file—a press of the Space Bar in the Finder is all it takes.
But you may be surprised to find that you can use Quick Look when working in Terminal, a decidedly non-GUI application. This feature can be useful if you’re working in Terminal and want to be sure a certain file is what you think it is before you do something to it. Instead of switching out to the Finder, or using the open
command, you can Quick Look the file directly from Terminal.
How? The key is a Unix program, qlmanage
, introduced in OS X 10.5 and built into macOS. This program was really designed for programmers writing Quick Look generators, but we can use it for our own purposes. To see the Quick Look preview for any file, just type qlmanage -p somefile
, where somefile
is the full name of a file in the current directory.
As an example, here’s how you could use Quick Look from Terminal to examine a PNG file. The two commands below first change to the Mac’s User Pictures/Fun folder in the Library folder, then ask the system to display the Quick Look preview for one of the images:
cd /Library/User Pictures/Fun qlmanage -p "Gingerbread Man.tif"
After you see quite a bit of text go flowing past in Terminal, a Quick Look window will open, displaying the Gingerbread Man user picture. It’s important to note that this is not the Finder’s Quick Look window—in fact, if you switch out to the Finder with the Terminal’s Quick Look window still showing, you’ll see that you can open new Quick Look windows in the Finder. To close the Terminal’s Quick Look window, you can either use the mouse and click the preview window’s close box, or (much simpler) just press Command-C to end the qlmanage
program.
IDG
[ad_2]
Source link