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.
Introduction
For quite a long time now websites with the so called "parallax" effect have been really popular.
In case you have not heard of this effect, it basically includes different layers of images that are moving in different directions or with different speed. This leads to a...
I get asked loads of questions every day but I'm always surprised that they're rarely questions about code or even tech -- many of the questions I get are more about non-dev stuff like what my office is like, what software I use, and oftentimes...
Note: For this tutorial, I'm using version1 of the Google Translate API. A newer REST-based version is available.
In an ideal world, all websites would have a feature that allowed the user to translate a website into their native language (or even more ideally, translation would be...
It's usually best to repair broken image paths as soon as possible because they can damage a website's credibility. And even worse is having a user tell you about it. Using jQuery and PHP, you can have your page automatically notify you of broken...
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