Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One-liner for previewing a file with Quick Look. I aliased this to `ql` :)

    qlmanage -p $argv >/dev/null 2>&1


I'm curious if there's a way to do this with standard input instead of having to supply a filename?

I do this with man pages but it opens up in a full Preview window, not QuickLook.


You can use process substitution[0] to have a command output act as a file:

  qlmanage -p <(man man) >/dev/null 2>&1
0 - https://www.gnu.org/software/bash/manual/html_node/Process-S... (it works in zsh too, but bash manual explains this feature more clearly)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: