I saw many answer related this question in "Stack Overflow" and "Ask Ubuntu". I also tried with this solution. I tried gnome-open and evince commands. This command works when the filename has one word. But my filename is "Java The Complete Reference Ninth Edition.pdf". Is there any solution to open this file using command in Terminal. I am using Ubuntu 14.04 LTS.

  • 1
    OpenSaysMe, I could not resist.... – Moab Apr 10 '16 at 18:21

Spaces in file names need to be escaped with a \, for example with a document called "Document Name.pdf" you need to type "evince 'Document\ Name.pdf'. Autocompletion in your shell should do this for you if you type for example "evince Doc" and press tab.


There are two ways to quickly open a pdf file from the terminal in Ubuntu without typing the pdf file's full name.

  1. You can use gnome-open or evince followed by a space character and then drag the pdf file's icon into the terminal to automatically input its full name.

  2. cd to the directory containing the pdf file and then you can use gnome-open or evince followed by a space character and type the first few letters of the pdf file's name followed by the Tab key to automatically complete the full name of the pdf file in the terminal. All of the space characters in the pdf file's name will be automatically replaced by a \ character, used to escape the next character in the string from not having a special meaning in the Bash shell, followed by a space character.


You can also do it with the filename between '"' characters, for example:

evince "Java The Complete Reference Ninth Edition.pdf"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.