There are different ways to customize the name by which you can launch an application:
Method 1 - Create an alias Next to all options given in the other answers, a convenient way to make it easier for you to start Chrome from the command line, and which does not require to be administrator, is to create an alias:
alias chrome=/opt/google/chrome/chrome
Add this command to your .bashrc
file (already, some other aliases are defined there), so it is available anytime.
Method 2 - Create a symlink also does not require root permissions: you can create your personal bin
folder in your home directory. There, create a symbolic link to the executable of Google Chrome as:
ln -s /usr/bin/google-chrome ~/bin/chrome
On Ubuntu, a local bin
folder is automatically added to the PATH. After creating the bin folder, it will take only effect after your next log in.
Method 3 - Create a systemwide symlink If the change is to affect all users, create an appropriately named symlink in /usr/bin. As mentioned in the other answers, a symlink may already be available. If you prefer the shorter name chrome
, feel free to create an additional symlink as
sudo ln -s /usr/bin/google-chrome /usr/bin/chrome
or rename the existing symlink.
Method 4 - Create a wrapper script. A simple executable bash script placed in your local bin
folder or in urs/bin
or another folder in your path would, for practical purposes, equally work. When executed, the script in turn calls the application by specifying its full pathway. A wrapper script is particularly suited if there is a need to customize the working environment prior to launching the application. Thus, the script could change the working directory, set or change environment variables, etc.
$PATH
– karlsebal Feb 15 '20 at 11:51hash -r
rereads the $PATH so bash knows the new contents of~/bin
– Thorbjørn Ravn Andersen Feb 15 '20 at 15:13chrome
andchromium
are distinct builds; I wouldn't suggest using one name as an alias for the other. – Peter Cordes Feb 15 '20 at 16:06