Open In App

xdg-open command in Linux with Examples

Improve
Improve
Like Article
Like
Save
Share
Report

xdg-open command in the Linux system is used to open a file or URL in the user’s preferred application.
The URL will be opened in the user’s preferred web browser if a URL is provided. The file will be opened in the preferred application for files of that type if a file is provided. xdg-open supports ftp, file, https and http URLs. This can be used inside a desktop session only. It is not recommended to use xdg-open as root. Here, the zero is an indication of success while non-zero show the failure.

Syntax:

xdg-open {file | URL}

Example:

xdg-open read.html

Options:

  • xdg-open –version : This option will show the xdg-utils version information.
    xdg-open --version

  • xdg-open –help: This option will show command synopsis.
    xdg-open --help

  • xdg-open –manual: This option will show the manual page.
    xdg-open --manual


Last Updated : 24 May, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads