HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

xdg-open — Open a file or URL in the user's preferred application. More information: <https://portland.freedesk

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandclifileopenuserxdg-openurl
linux

Problem

How to use the xdg-open command: Open a file or URL in the user's preferred application. More information: <https://portland.freedesktop.org/doc/xdg-open.html>.

Solution

xdg-open — Open a file or URL in the user's preferred application. More information: <https://portland.freedesktop.org/doc/xdg-open.html>.

Open the current directory in the default file explorer:
xdg-open .


Open a URL in the default browser:
xdg-open {{https://example.com}}


Open an image in the default image viewer:
xdg-open {{path/to/image}}


Open a PDF in the default PDF viewer:
xdg-open {{path/to/pdf}}


Display help:
xdg-open --help

Code Snippets

Open the current directory in the default file explorer

xdg-open .

Open a URL in the default browser

xdg-open {{https://example.com}}

Open an image in the default image viewer

xdg-open {{path/to/image}}

Open a PDF in the default PDF viewer

xdg-open {{path/to/pdf}}

Display help

xdg-open --help

Context

tldr-pages: linux/xdg-open

Revisions (0)

No revisions yet.