Open Pdf From Terminal Mac

broken image


In the Finder, open the Trash, and then drag the items it contains to the Terminal window. You'll see one or more files with paths such as /Users/.Trash/file.txt. Okular is a PDF viewer able to open PDF files at a specific page using the terminal with the following command: okular -p 5 'path/to/document.pdf' where -p option specifies the page of the document, 5 in this example, and the second argument specifies the path to the document to open.

Here are some quick tips that are handy if you work in a Terminal window a lot (I know I do!). They show various ways to open files and folders right from the command line.

Opening a file

You can open a file using its associated application by typing:

Open pdf from terminal mac download

Mac Open Terminal Shortcut

For example, opening an image file with open usually displays it in Preview, while opening an HTML file displays it in your default Web browser.

Wildcards are allowed, so you can open all PNG files in the current folder with:

You can also specify the application to use when opening the file by using the -a option:

Open pdf from terminal mac osx

Mac Open Terminal Shortcut

For example, opening an image file with open usually displays it in Preview, while opening an HTML file displays it in your default Web browser.

Wildcards are allowed, so you can open all PNG files in the current folder with:

You can also specify the application to use when opening the file by using the -a option:

Open mac formatted drive on windows 10. If you want to edit the file in TextEdit, use:

You can even open URLs:

Opening a folder

Open Pdf From Terminal Mac Mojave

This trick also works on folders, in which case the folder opens as a new Finder window:

For example, you can open the current folder in the Finder with:

Previewing a file

If you're running Leopard, you can even Quick Look a file using qlmanage, a debugging tool for the Quick Look Server:

(The >& /dev/null stops debug info being displayed in the Terminal window.)

Press Control-C when you're done to close the Quick Look window. Option click mac. Sims 4 pets free download for mac.

As with open, you can Quick Look multiple files at once:

You can then use the arrows at the bottom of the Quick Look window to move between each file, or click the Index Sheet button to view thumbnails of all the files at once.

More info on qlmanage, including various ways to create snappy aliases for the command, can be found on the Macworld site and on this blog.

Enjoy! 🙂

Bookmark this post:




broken image