I was trying to open a png file, but for some reason the xdg-open and gnome-open commands weren't working. For example:

-bash: gnome-open: command not found

Does anyone know why? I thought I could use Linux commands on Mac terminal.


If you're trying to open an image file like a .png, .jpg, etc. from Terminal in OS X, you can use open filename.png where filename.png is the actual pathname of the target image file. By default, it will open in Preview.

In Terminal, type man open and press enter to read the BSD General Commands Manual for the open command.

OS X is not Linux and Linux specific commands like xdg-open and gnome-open do not exist in
OS X unless they've been ported by managers like Homebrew and you have installed using one of the managers like Homebrew or installed from source code by yourself, that is if you can satisfy the dependancies involved too (which is what Homebrew does for the command it ports).

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .