Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

MacOS has a neat open command:

Does GNU/Linux have a similar command?

share|improve this question
up vote 1 down vote accepted

Yes, Linux is configurable, as Slowki says. However, that means that the answer is Yes.. Linux is configurable so it has at least five commands that are equivalent to this. Did you think that Linux developers would ignore such an idea? ☺

  • GNOME used to have gnome-open.
  • GNOME now has gvfs-open.
  • KDE has kde-open.
  • XFCE has exo-open, which uses the desktop's preferred applications settings.
  • The FreeDesktop people have xdg-open, which will try to invoke one of the preceding four, or attempt to perform something appropriate itself.

Of course, these are all predicated upon having a "desktop environment" of some sort. They all consult their various desktop environments' "settings" databases. (There's a rough agreement across several desktop environments about the settings databases.) But then so is your question, as MacOS 10's open is also predicated upon a desktop.

However, that doesn't mean that the TUI world is lacking similar tools. The run-mailcap command operates from the mailcap and mime.types settings files, for example. However, the TUI world is a subject better treated by a separate question.

Further reading

share|improve this answer

No, Linux is too configurable for that, on OSX you start off with Safari, the OSX File Manager, etc, but on my laptop right now I don't even have graphical and I work purely in TTY, to get an open command on Linux to work it would need to be told how to handle every file, which at that point I might as well just make my own.

if [ -d $1 ]; then #Check if $1 is a directory
    nautilus $1 #To be honest pcmanf is way better
if [ -f $1 ]; then #Check if $1 is a file
    if [ $1 == *.txt ]; then #Is the extension .txt?
        gedit $1

I personally prefer to alias the file extensions, so I can just type to path to the file and it will open it, decompress it, compile it, etc, it's one of the better features of ZSH, I recommend you try it.

share|improve this answer

You must log in to answer this question.

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