Installing and Running Applications in Bash
Explore methods to install applications such as Git in Bash. Learn how to run applications by executable name, absolute path, or relative path. Understand how to modify the PATH variable to execute programs installed in custom directories.
We'll cover the following...
Installing git
A good practice is to download all package information before installing any application. This can be done using the following command:
sudo apt-get update
Let’s install git now:
sudo apt-get install -y git
The -y flag is an automatic yes to prompts. It allows the process to run non-interactively.
Connect to the terminal.
Use
student-passwordas password if prompted to enter a password.
We can also check the version of git installed:
git --version
How to run an application
Now, we installed a new application. Its executable file will be in /usr/bin. How do we run this application in Bash? There are several approaches we can follow:
- By the name of the executable file.
- By the absolute path.
- By the relative path.
Let’s consider each approach in detail.
We used the first approach to call GNU ...