Determine Default App for File Type from Command Line

By  on  

One quality of life improvement any developer can make for themselves is ensuring different file types open in the app they're most proficient in. If you know me, you know I prefer accomplishing as much as possible from the command line. The duti utility allows users to determine default file type from command line.

The duti utility allows developers to query which app is the default for different file types. You can install duti with brew:

brew install duti

Once you have duti available, you can check on the default app for file type with the following command:

~ duti -x md
Xcode.app
/Applications/Xcode.app
com.apple.dt.Xcode

You can set the default app by using its package:

duti -s com.sublimetext.2 .js all

The duti utility is really great for determining and automating default app management!

Recent Features

Incredible Demos

  • By
    Create a Simple News Scroller Using MooTools, Part I:  The Basics

    News scroller have been around forever on the internet. Why? Because they're usually classy and effective. Over the next few weeks, we'll be taking a simple scroller and making it into a flexible, portable class. We have to crawl before we...

  • By
    MooTools Fun with Fx.Shake

    Adding movement to your website is a great way to attract attention to specific elements that you want users to notice. Of course you could use Flash or an animated GIF to achieve the movement effect but graphics can be difficult to maintain. Enter...

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!