{
    "mode": "man",
    "parameter": "xdg-open",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/xdg-open/1/json",
    "generated": "2026-05-30T06:08:14Z",
    "synopsis": "xdg-open {file | URL}\nxdg-open {--help | --manual | --version}",
    "sections": {
        "NAME": {
            "content": "xdg-open - opens a file or URL in the user's preferred application\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "xdg-open {file | URL}\n\nxdg-open {--help | --manual | --version}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "xdg-open opens a file or URL in the user's preferred application. If a URL is provided the\nURL will be opened in the user's preferred web browser. If a file is provided the file will\nbe opened in the preferred application for files of that type. xdg-open supports file, ftp,\nhttp and https URLs.\n\nxdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as\nroot.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "--help",
                    "content": "Show command synopsis.\n",
                    "long": "--help"
                },
                {
                    "name": "--manual",
                    "content": "Show this manual page.\n",
                    "long": "--manual"
                },
                {
                    "name": "--version",
                    "content": "Show the xdg-utils version information.\n",
                    "long": "--version"
                }
            ]
        },
        "EXIT CODES": {
            "content": "An exit code of 0 indicates success while a non-zero exit code indicates failure. The\nfollowing failure codes can be returned:\n\n1\nError in command line syntax.\n\n2\nOne of the files passed on the command line did not exist.\n\n3\nA required tool could not be found.\n\n4\nThe action failed.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "xdg-mime(1), xdg-settings(1), MIME applications associations specification[1]\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "xdg-open 'http://www.freedesktop.org/'\n\nOpens the freedesktop.org website in the user's default browser.\n\nxdg-open /tmp/foobar.png\n\nOpens the PNG image file /tmp/foobar.png in the user's default image viewing application.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "",
            "subsections": [
                {
                    "name": "Kevin Krammer",
                    "content": "Author.\n"
                },
                {
                    "name": "Jeremy White",
                    "content": "Author.\n"
                }
            ]
        },
        "COPYRIGHT": {
            "content": "Copyright © 2006\n",
            "subsections": []
        },
        "NOTES": {
            "content": "1. MIME applications associations specification\nhttp://www.freedesktop.org/wiki/Specifications/mime-apps-spec/\n\n\n\nxdg-utils 1.0                                08/22/2022                                  XDG-OPEN(1)",
            "subsections": []
        }
    },
    "summary": "xdg-open - opens a file or URL in the user's preferred application",
    "flags": [
        {
            "flag": "",
            "long": "--help",
            "arg": null,
            "description": "Show command synopsis."
        },
        {
            "flag": "",
            "long": "--manual",
            "arg": null,
            "description": "Show this manual page."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Show the xdg-utils version information."
        }
    ],
    "examples": [
        "xdg-open 'http://www.freedesktop.org/'",
        "Opens the freedesktop.org website in the user's default browser.",
        "xdg-open /tmp/foobar.png",
        "Opens the PNG image file /tmp/foobar.png in the user's default image viewing application."
    ],
    "see_also": [
        {
            "name": "xdg-mime",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xdg-mime/1/json"
        },
        {
            "name": "xdg-settings",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xdg-settings/1/json"
        }
    ]
}