$ open filename.png
$ open .
$ open -e filename.txt
$ open -a Pixen filename.png
The first command will open the file with the default application.
Open . will open the current directory in finder, which I find very helpful. The -e flag will open the file in textedit. The -a will open the file in the given application name.
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".
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.
This seems to run whatever code usually runs when you hit [space] on a filename in a Finder window. (Except that it outputs a bunch of debugging information.) Under what circumstances is that any better or more useful than "open"?
Correct (man 1 qlmanage). Depending on the type of file, it is usually faster to open quicklook than opening the file in its default application, especially if you just want to take a look and you don’t actually need to edit the file.
Comments (395) 107 threads
Show all comments
Showing thread 2 of 107
Open . will open the current directory in finder, which I find very helpful.
The -e flag will open the file in textedit.
The -a will open the file in the given application name.
On Windows the equivalent is start (e.g. start C:\ )
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 ""
Continue this thread — 1 reply