Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I am beginning to learn and love ubuntu. Is there any way to open files like .pdf, .jpeg, .odt, .docx etc. using command line?

For instance, I have a pdf named: 9949107741MathFormulas.pdf in the following directory:

jitendra@jitendra:~/Downloads/Math.Formulas.and.Tables.8.Retail$

when I go to above directory type 9949107741MathFormulas.pdf to open it, I get the message:

9949107741MathFormulas.pdf: command not found

Please advise, how can this task be accomplished?

share|improve this question

marked as duplicate by Radu Rădeanu, vasa1, Basharat Sialvi, chronitis, Kevin Bowen Jul 23 '13 at 10:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Would you do the same thing in any other OS? Just type in a filename and hit enter? –  user25656 Jul 22 '13 at 14:44
add comment

2 Answers 2

up vote 2 down vote accepted

You fist need to ask the application to open it. For pdf, you can call "evince".

Example command:

evince example.pdf
share|improve this answer
    
Thanks, now I understand. Do I need to close this question, if so, how can it be done? –  Jitendra Jul 22 '13 at 14:19
    
don't have to do anything... This is a possible duplicate of How to open a PDF file from terminal?. You did your part. –  M.Meintjes Jul 22 '13 at 14:29
add comment

I know you already accepted an answer but I think it will be better if you know that this has been discussed in the past with better answers like this one, which I reproduce right here for you.

xdg-open file.dvi

xdg-open will open any file with its default application. As a bonus, you can close the terminal without killing the application.

Since xdg-open is quite a long name, I put an alias for it in .bashrc:

alias go='xdg-open'

This way you don't need to know what application open this file or another. xdg-open will invoke whatever software is related to the file contents or extension.

Don't forget to give credit to Mihai Capotă for his good answer.

Good luck!

share|improve this answer
add comment

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