Hacker News new | ask | show | jobs
by panzi 4544 days ago
Under Linux there is a similar command: xdg-open
2 comments

or gnome-open.

On Windows the equivalent is start (e.g. start C:\ )

I use start all the time, but also frequently curse at its stupid argument grammar and its interaction with auto-quoting on auto-completion. For example, type

  start C:\Doc
Next, hit tab to get

  start "C:\Documents and Settings"
Now, hit return, and watch a new command window open with title "C:\Documents and Settings".

Reason? If the first argument is a quoted string, it is used as the title of the window being opened (http://www.microsoft.com/resources/documentation/windows/xp/..., http://stackoverflow.com/questions/154075/using-the-dos-star...)

If you ever use start in batch scripts, pass a dummy first argument of ""

You can use `explorer`, which doesn't exhibit this behavior:

    explorer "C:\Documents and Settings"
does what you'd expect.
I think xdg-open defers to gnome-open/kde-open/... depending on what DE is currently running. Not sure about that. Anyway, xdg-open should be installed anywhere where any kind of DE is installed.
For the lazy:

  $ echo "alias o='xdg-open'" >> ~/.bashrc