Quick Look on the CLI

A quick tip about using the qlmanage command to see the Quick Look preview of a file from the command line. Define this shell function:

ql(){
qlmanage -p $@ 2>/dev/null
}
Then you can invoke it as ql FILENAME when needed. Use C-c to exit.

Update: Scott left a great suggestion to use $@ instead of $1. This allows you to bring Quick Look up for multiple files. (It even provides a contact sheet view, nice.) Thanks Scott!

2 thoughts on “Quick Look on the CLI

  1. Hello. A quick improvement on your macro is to add “$@” instead of just $1. This not only allows spaces etc in file names, but uses multiple files. So now “ql *.jpg” will show all files with next/previous buttons working inside Quick Look.

    Ta

    Scott

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>