Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • thanks. Is it true that in terminal, we always have to explicitly specify which application to open a file (except script with shebang)? Does the settings of which application to open a file of a certain format by default belong to the file manager (e.g. Nautilus), while it is not an issue when we are living in terminals? Commented Aug 7, 2014 at 16:31
  • If you want to use the Gnome associations from the command line, you can use the command gnome-open. I'm sure there are similar command line tools for the other desktop environments. Edit: I just note that John WH Smith gives a command that is independent from your desktop environment. Commented Aug 7, 2014 at 16:35
  • 6
    Correction: the shebang line is not a message to the kernel; it's a message to the shell. Commented Aug 7, 2014 at 22:21
  • 1
    @Kazark: coderwall.com/p/pdg77q Commented Aug 8, 2014 at 9:21
  • 2
    Since the link to actual code in that linked page doesn't seem to work now, here's another link to the kernel code handling shebang lines: lxr.free-electrons.com/source/fs/binfmt_script.c — of course you could also just install the kernel sources yourself and look into the file. Commented Aug 8, 2014 at 9:30