Small things make yor life nicer

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.

7 thoughts on “Small things make yor life nicer

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

  3. 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)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s