Create a Bash script and save it in a folder so that you can run the script only when you are in that folder. ls imagemagick apache and Squid are installed in different directories but do you know how to access them from anywhere? This is because individual paths have been added to the "paths" variable. Adding more paths allows the script to run anywhere.
Add a Route to Bash
Before you begin, you should explain that you can adjust routes at three different levels because of the way that Linux security works. Bash is the first one. Everything you see here affects Bash and everything running inside it, but not "outside Bash".
Suppose you have a collection of scripts in a folder that you want to access anywhere.
You can add a path to “~ / .bashrc” to free it. You can open the ".bashrc" file (in your home directory but hidden by default) in your favorite text editor, like gedit.
You don't need to be uppercase. I used this folder to highlight where and how to include it.
Log out and log back in for changes to take effect as before. The above trick allows you to run scripts from anywhere on Linux.
Was this article helpful?
Please Note: This content is provided and hosted by a 3rd party server. Sometimes these servers may include advertisements. igetintopc.com does not host or upload this material and is not responsible for the content.