Find the default application for a certain extension

sjsam

Given xdg-open and an extension, is there a way to get the application which xdg-open is set to for that particular extension?

For example given xdg-open and .jpg the result is eog.

steeldriver

AFAIK the choice of action is based on the file's mimetype rather than its extension.

At least on Ubuntu, you should be able to use the query action of xdg-mime to show the default application for a specific mimetype

$ xdg-mime query default image/jpeg
eog.desktop

You can check the mimetype for a particular file using xdg-mime query filetype e.g.

$ xdg-mime query filetype kqDRdnW.jpg
image/jpeg

or using the file command e.g. file --mime-type <file>

See man xdg-mime for further usage information.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to set default application for a specific file extension

분류에서Dev

Find Certain String Indices

분류에서Dev

Changing the default program for an application

분류에서Dev

Extension to turn off certain page element?

분류에서Dev

Hiding files of a certain extension (.pyc) from Nautilus

분류에서Dev

Find if certain characters are present in a string

분류에서Dev

Is there a setting/extension to default tabs to muted in Chrome?

분류에서Dev

No default engine was specified and no extension was provided - error in expressjs

분류에서Dev

List of all default application programmatically

분류에서Dev

chrome extension: how to mute all audio from certain tab

분류에서Dev

Removing files with a certain extension except one file from terminal

분류에서Dev

Find all files that are NOT of a specific type/extension in folder?

분류에서Dev

Find a regular extension of domains on a string python Regex

분류에서Dev

Need to find list of scripts that uses a certain file

분류에서Dev

Use 'find' to find and delete large files of a certain type

분류에서Dev

Include our application in default popup to launch the media

분류에서Dev

Windows 7 does not update the default application path

분류에서Dev

Default username and password in Worklight Application Center

분류에서Dev

Default Cocoa Application ViewController.m issue?

분류에서Dev

How to get the default version of an application in unix

분류에서Dev

Setting default application for filetypes via CLI?

분류에서Dev

Is it possible to update the HTML content of a page using a Firefox extension or desktop application?

분류에서Dev

how to find all files of a given extension excluding multiple filename strings

분류에서Dev

Directed cyclic graph traversal to find a path of certain length

분류에서Dev

Find elements within a certain div and output their respective text with jQuery

분류에서Dev

Find followers of an element in a certain scope, which aren't siblings

분류에서Dev

How to find the positions of a list of certain number in a number list

분류에서Dev

How to find some arrays with certain value and sum their values?

분류에서Dev

Find records which assoicated records do not belong to certain record

Related 관련 기사

  1. 1

    How to set default application for a specific file extension

  2. 2

    Find Certain String Indices

  3. 3

    Changing the default program for an application

  4. 4

    Extension to turn off certain page element?

  5. 5

    Hiding files of a certain extension (.pyc) from Nautilus

  6. 6

    Find if certain characters are present in a string

  7. 7

    Is there a setting/extension to default tabs to muted in Chrome?

  8. 8

    No default engine was specified and no extension was provided - error in expressjs

  9. 9

    List of all default application programmatically

  10. 10

    chrome extension: how to mute all audio from certain tab

  11. 11

    Removing files with a certain extension except one file from terminal

  12. 12

    Find all files that are NOT of a specific type/extension in folder?

  13. 13

    Find a regular extension of domains on a string python Regex

  14. 14

    Need to find list of scripts that uses a certain file

  15. 15

    Use 'find' to find and delete large files of a certain type

  16. 16

    Include our application in default popup to launch the media

  17. 17

    Windows 7 does not update the default application path

  18. 18

    Default username and password in Worklight Application Center

  19. 19

    Default Cocoa Application ViewController.m issue?

  20. 20

    How to get the default version of an application in unix

  21. 21

    Setting default application for filetypes via CLI?

  22. 22

    Is it possible to update the HTML content of a page using a Firefox extension or desktop application?

  23. 23

    how to find all files of a given extension excluding multiple filename strings

  24. 24

    Directed cyclic graph traversal to find a path of certain length

  25. 25

    Find elements within a certain div and output their respective text with jQuery

  26. 26

    Find followers of an element in a certain scope, which aren't siblings

  27. 27

    How to find the positions of a list of certain number in a number list

  28. 28

    How to find some arrays with certain value and sum their values?

  29. 29

    Find records which assoicated records do not belong to certain record

뜨겁다태그

보관