Get Into PC

We Warm Welcome by Get Into PC your Biggest source for new versions of softwares and Apps for PC, Macintosh and Linux Getintopc.

How to Make Your Scripts Executable Everywhere in Linux

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.

  Add Directories To Path Script Folder

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.

Go to the end of the file and add the following:

  Add a directory to the path bash path

For example, run scripts If you keep the "/ home / myname / scripts" folder, the command is:


Related Posts

Read also x