3

I'm using this command: gnome-open file_name.xxx(xxx file extension) command but it's not working. I'm using Ubuntu 14.04.

0
7

You could either try xdg-open (xdg-open - opens a file or URL in the user's preferred application):

xdg-open /path/to/file.pdf

Or you directly launch Evince, the default Ubuntu document viewer, and open the file with it:

evince /path/to/file.pdf

Note that you must always quote path names with special characters like spaces or colons - or escape each of those characters using a backslash:

xdg-open '/path/with:some/special characters/strange filename.pdf'
xdg-open "/path/with:some/special characters/strange filename.pdf"
xdg-open /path/with\:some/special\ characters/strange\ filename.pdf'

evince '/path/with:some/special characters/strange filename.pdf'
evince "/path/with:some/special characters/strange filename.pdf"
evince /path/with\:some/special\ characters/strange\ filename.pdf'

You may chose the variant you prefer.

2
  • xdg-open file.pdf is works when file name is single word.How can I do for multiple word.i,e "Java The Complete Reference Ninth Edition.pdf" – alhelal Mar 10 '16 at 0:40
  • @al_helal quote it: xdg-open "Java The Complete Reference Ninth Edition.pdf" – muru Mar 10 '16 at 0:59

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