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.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Furl
  • Google Bookmarks
  • email
  • StumbleUpon

Related posts

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

7 Responses to “Small things make yor life nicer”

  1. koke says:

    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 says:

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

  3. koke says:

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

  4. Phil says:

    “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 says:

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

  6. Simon Wunderlin says:

    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 says:

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

Leave a Reply