LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

xdg-open

Open files with preferred application

TLDR

Open current directory in file explorer
$ xdg-open .
copy
Open a URL in default browser
$ xdg-open https://example.com
copy
Open an image in default viewer
$ xdg-open path/to/image.png
copy
Open a PDF in default viewer
$ xdg-open path/to/document.pdf
copy
Open a video in default player
$ xdg-open path/to/video.mp4
copy

SYNOPSIS

xdg-open file|URL

DESCRIPTION

xdg-open opens a file or URL in the user's preferred application. It is part of the xdg-utils package and works across different desktop environments by detecting which one is running and using the appropriate method.

PARAMETERS

--help

Display help message
--version
Display version information

SUPPORTED DESKTOP ENVIRONMENTS

xdg-open detects and uses the appropriate method for:- GNOME (gio open or gnome-open)- KDE (kde-open or kfmclient)- Xfce (exo-open)- MATE (mate-open)- Enlightenment (enlightenment_open)- Generic fallback (mimeopen)

INSTALL

sudo dnf install xdg-utils
copy
sudo pacman -S xdg-utils
copy
sudo apk add xdg-utils
copy
sudo zypper install xdg-utils
copy
nix profile install nixpkgs#xdg-utils
copy

CAVEATS

The file or URL is opened asynchronously; xdg-open returns immediately. The application chosen depends on the desktop's MIME type associations. On systems without a desktop environment, it may fall back to text-based alternatives.

HISTORY

xdg-open is part of xdg-utils, a set of scripts for desktop integration developed by the freedesktop.org project to provide consistent behavior across different Linux desktop environments.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid