Linux custom executable globally available

Posted on Mar 29, 2022

Question

I downloaded the Google App Engine as a zip format, unzipped it to /usr/local/google_engine

Now I need to run a python script from that folder all the time. How do I make it available no matter where my path is? ie: when i'm in /usr/something/ i can execute the script by just calling script.py?

Can I do this without aliasing or without using bash scripts?

Answer

Edit your .bashrc to add the desired directory on the PATH environmental variable.

export PATH=/usr/local/google_app_engine/bin:$PATH

then, either start new terminal or do,

source ~/.bashrc

Now try to run the script from anywhere.

Another way you can do it without even touching the .bashrc would be to create a symlink by doing something like,

sudo ln -s /usr/local/google_app_engine/bin/script.py /usr/bin/script.py