Quick and easy change default ‘open with’ in linux (command line)

I often need this but can never remember how to do it, so once again turning to my blog-as-a-diary method :).

Sidenote: In both KDE and Gnome, I find the way default file associations are handled to be repulsive. Someone obviously copied the Windows way of doing it instead of starting at ground zero and thinking about something more intuitive.

My problem: I found that I had used the ‘right click: open with…’ context menu with a folder, somehow, and set up folders to open up with Sublime Text. This is obviously very nice when intended but it had the horrible side effect of completely messing up Firefox Downloads’ ‘Open Containing Folder’ menu. All my download folders were causing Sublime Text to open. Obviously not ideal.

It took me a while to find out exactly where these default associations are stored. Here it is.


Easy when you know where… like all things linux.