Understanding `xdg-open` Command on Linux Systems

Linux distributions use a desktop environment system known as XDG, which stands for "X Desktop Group". This standard provides guidelines to create portable applications that can run consistently across different environments. The command `xdg-open`, when invoked in the terminal or via an application'energized user interface like your shell prompt (CLI), serves a specific purpose within this environment framework:

`xdg-open`: A utility that invokes the default program on your system for opening various types of files. It ensures consistency across different desktop environments by utilizing configuration data to determine which application should open certain file types or URLs based on user preferences stored in a unified manner, typically within `~/.config/mimeapps.list`.

`xdg-open`: Works hand-in-hand with the desktop environment's settings and configuration files to open applications for different file types or URLs based on user preferences set in `~/.config/mimeapps.list`. Here is a step by step process of how it opens an application:

- xdg-open myfile.txt

- `xdg-open example.txt`: Opens a text file named "example" in Notepad++ application if it's set as default for .txt files; otherwise defaults to whatever was configured by user or falls back on system defaults based upon the MIME type identification within '~/.config/mimeapps.list'.
- `xdg-open example.pdf`: Opens a PDF file named "example" in Adobe Reader application, if set as default for .pdf files; otherwise follows same lookup logic using user settings or system defaults based upon MIME type identification within '~/.config/mimeapps.list'.
- `xdg-open myURLString`: Opens a string formatted URL input into the browser of your choice (e.g., Chrome, Firefox) following whatever preference was set in mimeapps.list for opening URLs; otherwise falls back to default web browsers on system path: either Google Chrome or Mozilla Firefox if available as per user preferences/settings within '~/.config/mimeapps.list'.
- `xdg-open myEmail@example.com`: Opens an email address in your preferred Email client (e.g., Thunderbird, Evolution) following whatever preference was set by the user for opening emails via mimetype preferences within '~/.config/mimeapps.list'.