How to launch pdf viewer from the terminal
You can just use open &lt;filename.pdf&gt; and your OS will use the default program to view PDFs. With open -a Preview.app &lt;filename.pdf&gt; your PDF is opened using Preview, even if your default PDF reader is something different.