Koke’s

My English alter-ego

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.

Bookmark this post: · Del.icio.us · YahooMyWeb · Spurl · Furl · Incoming links

AddThis Social Bookmark Button   AddThis Feed Button

7 Responses to “Small things make yor life nicer”

Comments

  1. koke Mar 01 2006 / 7am

    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.

  2. Wout Mar 01 2006 / 8am

    If you name the alias gopen there is no compatibility problem…

  3. koke Mar 01 2006 / 9am

    True, but open is shorter. In fact, I’m thinkin about calling the alias “@o@” for maximum performance :)

  4. Phil Mar 01 2006 / 12pm

    “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?

  5. omer Mar 02 2006 / 11pm

    i aliased gnome-open for ‘go’, which is an acronym for gnome-open and kind a metaphore of the action itself.

  6. Simon Wunderlin Mar 05 2006 / 3am

    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)

  7. Zerny Mar 10 2006 / 12pm

    You could also use the existing command `see’ that uses your /etc/mailcap to find a program to view the file

Leave a Reply