brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: qlmanage -p opens Quick Look from the terminal

Terminal
~/tips/tip-macos-qlmanage-preview

qlmanage -p report.pdf

Opens the Quick Look preview of a file straight from the terminal.

Pressing Space in Finder is the usual way to peek at a file. The terminal has its own version.

qlmanage -p displays the Quick Look preview for the files you give it.

qlmanage -p report.pdf

That is handy when you are already deep in a folder in the shell and do not want to switch to Finder, or when you want to check a file before you open it with a heavy app. Several files can go on one line.

There is also -t, which displays the generated thumbnails for the files instead of the preview.

qlmanage -t photo.heic

The caveat: it prints some debug noise in the terminal, and the preview window is tied to the command. When you are done, close the window or end the command. If a file type has no Quick Look generator you get a generic icon, not a preview.

Quick Look is built on the idea that looking at a file should not need an app. The terminal version gives that idea to people who live in the shell all day.

Further reading: qlmanage.1 man page, Use Quick Look to preview files on Mac (Apple Support), On this site: mdfind -name searches by file name from the terminal, using Spotlight, On this site: mdls -name kMDItemWhereFroms tells you where a download came from

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link