Finding the preferred application for a given file extension via unix shell commands
问题 this may not be strictly about programming, but if I find no ready-made solution it may become a programming task: On UNIX, what is a command-line method for determining the user-preferred application for a given filetype? My ideal solution here would be a command that stopped me having to do the following: okular foo.pdf And allowed me to do something like this, working with my set preferred applications: launch foo.pdf I found no answer by searching, and a DIY approach wouldn't work as,