I wanna know if I can open any file in default…
for ex:
- open example.txt (Kate)
- open example.pdf (Okular)
I wanna know if I can open any file in default…
for ex:
Clicking on a file will normally open said file in the appropriate application, depending on what flavor of desktop you are using. This is made possible by way of the xdg-open
framework, which will look at what application any given file type is associated with.
You can use xdg-open
as a generic command, but there’s a lot more overhead involved in that than when you simply pass the file to the correct command yourself, as in for example…
kate example.txt
xdg-open <filename>
It works with qpdf as mime for pdf files - at least on my Openbox system
Beware of how you intend to use it: since it uses the association between a MIME type and (usually) a graphical application, it may not be appropriate for CLI specific scripts.
Ty,
I tried to do alias… but it’s doesn’t work, can u tell me reason?
alias xdg-open=open
the open command is a built-in for the shell - that won’t do.
just use xdg-open
Okay, it’s not a problem. Style short cmd so…
You can create an alias - I just realized you had reversed the arguments
alias open='xdg-open'
and my synapses wrongly associated the keyword open
with read
- as in read a file.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.