Determine Default App for File Type from Command Line

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 […]

The post Determine Default App for File Type from Command Line appeared first on David Walsh Blog.


This content originally appeared on David Walsh Blog and was authored by David Walsh

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!

The post Determine Default App for File Type from Command Line appeared first on David Walsh Blog.


This content originally appeared on David Walsh Blog and was authored by David Walsh


Print Share Comment Cite Upload Translate Updates
APA

David Walsh | Sciencx (2022-10-02T22:50:28+00:00) Determine Default App for File Type from Command Line. Retrieved from https://www.scien.cx/2022/10/02/determine-default-app-for-file-type-from-command-line/

MLA
" » Determine Default App for File Type from Command Line." David Walsh | Sciencx - Sunday October 2, 2022, https://www.scien.cx/2022/10/02/determine-default-app-for-file-type-from-command-line/
HARVARD
David Walsh | Sciencx Sunday October 2, 2022 » Determine Default App for File Type from Command Line., viewed ,<https://www.scien.cx/2022/10/02/determine-default-app-for-file-type-from-command-line/>
VANCOUVER
David Walsh | Sciencx - » Determine Default App for File Type from Command Line. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/10/02/determine-default-app-for-file-type-from-command-line/
CHICAGO
" » Determine Default App for File Type from Command Line." David Walsh | Sciencx - Accessed . https://www.scien.cx/2022/10/02/determine-default-app-for-file-type-from-command-line/
IEEE
" » Determine Default App for File Type from Command Line." David Walsh | Sciencx [Online]. Available: https://www.scien.cx/2022/10/02/determine-default-app-for-file-type-from-command-line/. [Accessed: ]
rf:citation
» Determine Default App for File Type from Command Line | David Walsh | Sciencx | https://www.scien.cx/2022/10/02/determine-default-app-for-file-type-from-command-line/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.