I want to be able to open files like my operating system does from console.
e.g. a .pdf
file should be opened with evince
or whatever the default application to open pdfs is. All the other things should work too; images -> eog
, text files -> gedit
and so on.
I hope that there is a solution for this, it would be really practical.
Best Answer
But what if you want to change the preferred application from the terminal?
Try this
You can use the xdg-mime program to first check which is the current default application that will open a file and then you can switch it to what ever application you want.
Now as mentioned by jokerdino you can use xdg-open to open a file with your preferred application: