Open Files from Command Line on OS X
I'm as much of a fan of application UIs as anyone else but I'm finding myself working more and more from the command line lately. Much of that is becoming obsessed with media manipulation but I'm forcing myself to use less UIs so that I can understand what's under the hood of my favorite utilities.
One common case for running any app is opening an existing file, like an HTML file in a browser or a document in Pages. To open a file on Mac OS X from the command line, type the following:
open portrait.png
The above does not specify an app to open the given file in -- the default app for that file type will be used. To open a file in a specific app, use the -a
argument:
open -a /Applications/Firefox.app portrait.png
You can also open a URL directly from the command line:
open https://davidwalsh.name/
You'd expect opening a file from command line to be easy and I'm happy to confirm to you that it is.
CSS cubes really showcase what CSS has become over the years, evolving from simple color and dimension directives to a language capable of creating deep, creative visuals. Add animation and you've got something really neat. Unfortunately each CSS cube tutorial I've read is a bit...
My team mate Edna Piranha is not only an awesome hacker; she's also a fantastic philosopher! Communication and online interactions is a subject that has kept her mind busy for a long time, and it has also resulted in a bunch of interesting experimental projects...
We all joke about the days of Web yesteryear. You remember them: stupid animated GIFs (flames and "coming soon" images, most notably), lame counters, guestbooks, applets, etc. Another "feature" we thought we had gotten rid of was the marquee. The marquee was a rudimentary, javascript-like...
The idea of image preloading has been around since the dawn of the internet. When we didn't have all the fancy stuff we use now, we were forced to use ugly mouseover images to show dynamism. I don't think you were declared an official...
I was just wondering how to do this, thanks!
When you use
-a
, you don’t need to write the path.…would do the same. :)
The
-a
handler is great when you want to open some program one doesn’t really know (eg remember) exactly where it is.Like:
// that one is in /System/Library/CoreServices