HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

duti — Set default applications for document types and URL schemes on macOS. See also: `osascript`. More in

Submitted by: @import:tldr-pages··
0
Viewed 0 times
documentduticommandcliapplicationssetfordefault
macos

Problem

How to use the duti command: Set default applications for document types and URL schemes on macOS. See also: osascript. More information: <https://github.com/moretension/duti>.

Solution

duti — Set default applications for document types and URL schemes on macOS. See also: osascript. More information: <https://github.com/moretension/duti>.

Set Safari as the default handler for HTML documents:
duti -s {{com.apple.Safari}} {{public.html}} all


Set VLC as the default viewer for files with .m4v extensions:
duti -s {{org.videolan.vlc}} {{m4v}} viewer


Set Finder as the default handler for the ftp:// URL scheme:
duti -s {{com.apple.Finder}} "{{ftp}}"


Display information about the default application for a given extension:
duti -x {{ext}}


Display the default handler for a given UTI:
duti -d {{uti}}


Display all handlers of a given UTI:
duti -l {{uti}}

Code Snippets

Set Safari as the default handler for HTML documents

duti -s {{com.apple.Safari}} {{public.html}} all

Set VLC as the default viewer for files with `.m4v` extensions

duti -s {{org.videolan.vlc}} {{m4v}} viewer

Set Finder as the default handler for the ftp:// URL scheme

duti -s {{com.apple.Finder}} "{{ftp}}"

Display information about the default application for a given extension

duti -x {{ext}}

Display the default handler for a given UTI

duti -d {{uti}}

Context

tldr-pages: osx/duti

Revisions (0)

No revisions yet.