Does there exist an 'Open' command-line utility similar to MacOS?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am not sure if I completely understand your question.
When you are in a graphical environment in Linux (Gnome, KDE, etc.) and you use your file browser, you can choose with which application to open a file. Moreover, you can also set the default application associated with the file type in question.
Select the specific file, do a right-click and then choose "Open with". In Gnome's default file manager Nautilus, Dolphin from the KDE desktop environment should do the same as should all other graphical file browsers, you will be presented a list of suggested applications.
The preferred one is not among them, then choose a different one. There is also the option to set a specific program as the default option.
Does this answer your question?
There are also programs, KDE System Settings is the only one that I have in my memory, there are others as well, where you can set default applications for all kinds of file types (as well as icons). You can play around with that, but I remember I spent a lot of time, several hours, as pretty much all imaginable file types for a desktop system are listed there.
The link below discusses several options which can be used to do this. Methods vary to some extent based upon which Desktop Environment and/or distribution of Linux you are using. You failed to mention that in your post so the link below is a how-to on Ubuntu. If you're using something else, an online search with that distribution name should provide you with more specific results.
Sorry, I should have clarified - I am running Linux Mint Tricia (19.3), with I3 gaps as the window manager.
I was more after a command line solution, since I mostly navigate around using the command line. So I was wondering if there was a utility with a config file for example such that when I type 'open foo.pdf' it will open it with zathura, open 'foo.mp4' it will open with VLC etc, or whichever programs I specify to open which type of file
Does there exist such a thing in Linux where the user can specify with which program to run which file types?
Looks like you're looking for something like
Quote:
xdg-open - opens a file or URL in the user's preferred application
although that is meant more for a desktop environment (as for URL's the default application is a web-browser). With the xdg-mime(1) or xdg-settings(1) commands you can specify your preferred MIME application associations.
See the man pages for those commands (if you got xdg-utils installed, of course).
These are tools from the free desktop organisarion www.freedesktop.org/wiki
yeah MIME type determine what apps open what files. you can even open up your file manager, right click on the file then select what app to use to open it with. then that sets it too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.