Small things make yor life nicer
Posted by Jorge Bernal March 01, 2006
After some time trying OSX, I noticed a small feature that I liked a lot. When you are in a terminal, you can use open foo/bar/file.ext to open it with the default application.
Fortunately, this is not only an OSX feature. We have the same stuff, it’s called gnome-open and it has been there for a while.
The problem is that gnome-open is too large as a shortcut for frequent use, so you can add the following to your ~/.bashrc:
alias open='gnome-open'
Warning: there is already a command called open, which is in fact a link to openvt. Please notice that this can affect some existing scripts.

After some time trying OSX, I noticed a small feature that I liked a lot. When you are in a terminal, you can use
open foo/bar/file.extto open it with the default application.Fortunately, this is not only an OSX feature. We have the same stuff, it’s called
gnome-openand it has been there for a while.The problem is that
gnome-openis too large as a shortcut for frequent use, so you can add the following to your~/.bashrc:alias open='gnome-open'Warning: there is already a command called
open, which is in fact a link toopenvt. Please notice that this can affect some existing scripts.If you name the alias gopen there is no compatibility problem…
True, but open is shorter. In fact, I’m thinkin about calling the alias “@o@” for maximum performance
“o” seems the obvious choice to me too. I already use “n” for “nautilus .”, and that doesn’t cause any problems, because who else would go around relying on one letter commands?
i aliased gnome-open for ‘go’, which is an acronym for gnome-open and kind a metaphore of the action itself.
put it in ~/.profile and it is only available in interactive shell sessions. Other “scripts” would still use the “old” open command.
PS: you shell must read .profile at startup, make sure to invoke it with the interactive flag (–login for bash)
You could also use the existing command `see’ that uses your /etc/mailcap to find a program to view the file