ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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, but I believe in Windows you can run
Code:
> start SomeTextFile.txt
on a terminal and Windows will open the text file with whatever program is configured as the default one for opening .txt files.
Whether that is true or not, is there such a thing on Linux?
I remember there used to be such a command for KDE a very long time ago (like 15 years ago), but I don't know if it is still used and, anyway, I need some command that does not rely on KDE. It just has to assume the user has a graphical environment. Is that possible?
TIA
unfortunately linux has not such a script for that. you will end up in nothing likely on some boxes.
Solution: From Source is magic.
The best is that you think about X11 lib or other small size libs, and you can compile your notepad with GCC or CLANG. See BSD for instance, there are cool projects for that (small size and readily compilable).
I am not sure, but I believe in Windows you can run
Code:
> start SomeTextFile.txt
on a terminal and Windows will open the text file with whatever program is configured as the default one for opening .txt files.
Whether that is true or not, is there such a thing on Linux?
I remember there used to be such a command for KDE a very long time ago (like 15 years ago), but I don't know if it is still used and, anyway, I need some command that does not rely on KDE. It just has to assume the user has a graphical environment. Is that possible?
Distribution: openSUSE, Raspbian, Slackware. Older: Coherent, MacOS, Red Hat, Big Iron IXs: AIX, Solaris, Tru64
Posts: 2,744
Rep:
Quote:
Originally Posted by jmgibson1981
Can also do alias's. I don't use them but many do. Then you can type in whatever you want.
Seconded for aliases. Those -- and shell scripts in my ~/bin directory (in your PATH, of course) -- handle all the custom commands you can think of.
Re: xdg-open
When I issue "xdg-open some-text-file" (on Leap 15.3) it launches Kate BUT it also dumps
Code:
kf.sonnet.core: Unable to find any suggestion for "dummy to trigger identify"
kf.kio.core: We got some errors while running testparm "Weak crypto is allowed"
to stderr. Ugh. An alias that includes "2>/dev/null" is needed to clean things up.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.