On some systems, the open
command actually refers to the run-mailcap
command. By default, running open
is the same as running run-mailcap
. Generally, it is safe to override open
with a Bash alias, since that only affects the current shell session, and not Bash scripts within that session. Put this in your .bashrc
:
alias open='xdg-open'
Debian 11 and related distros (such as Ubuntu 21.10 or later) use the update-alternatives
system to manage the open
command. So, if you want, you can configure the open
command system-wide to refer to xdg-open
, like this:
sudo update-alternatives --install /usr/bin/open open /usr/bin/xdg-open 50
sudo update-alternatives --config open
open
command is available as a convenience alias toxdg-open
(by default) orrun-mailcap
, managed by theupdate-alternatives(1)
system. It is intended for interactive use at the command line, to open files with their default application, which can be a graphical program when available."