Linux – a linux cli equivalent to mac’s “open” command? or windows “start” command

command linelinux

In a mac cli, I can type open file.jpg and the mac will automatically figure out the correct application and open it for me.

In Windows, the start command does the same thing, but also will open up explorer to working directory if given no parameters.

Is there a way to do that in linux? (maybe only certain distros?)

Best Answer

If XdgUtils is installed files can be opened via

xdg-open file

Otherwise there might be something provided by the desktop environment, e.g. for gnome

gnome-open file
Related Question