Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

With a desktop environment, there are file associations that goes with it.

I'm a minimalistic user, who doesn't use any of such, but still want some kind of file associations to ease my burden.

So I'm searching for a program that does something like the following.

open file.pdf

this will look at the extension, and translate to okular file.pdf.

Of course one can always write a bash script to do this. I wonder if there is something existing, so I don't reinvent the wheel.

share|improve this question

3 Answers 3

You want xdg-open for this.​

share|improve this answer

You can use gnome-open for ubuntu / gnome.

share|improve this answer

You could also use zsh

# Suffix aliases (Type a file as a command and this program will launch)        
alias -s jpg=gthumb
alias -s png=gthumb
alias -s pdf=okular
alias -s html=firefox
alias -s ogg=mplayer

In your example you would just type file.pdf and okular would start

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.