So I just came across this really cool thing so I learned you can run a program you're working on in Linux from the terminal with out being in the directory the program is in so if I type
root@local/: helloworldscript
The script from which dir it's in will run and the return will be
root@local/: helloworldscript
Hello world
root@local/:
You can do this by using links here's how you do it (I usually put my custom scripts in the /opt dir
ln -s /opt/scripts/helloworldscript.py /usr/bin/helloworldscript
So what's going on is that you're basically creating a symbolic link that the system can use as a command
ln - link command
-s - creates a symbolic link
/opt/scripts/helloworldscript.py - Specify the directory where the program is located( use the entire name of the program including extension)
/usr/bin/helloworldscript - the directory where it will be run (usr/bin is kinda like sys32 that's where commands are recognized from) and the name "helloworldscript" you can call the command whatever you like just as long as the directory and your /usr dir is correct.
Happyhunting ?
root@local/: helloworldscript
The script from which dir it's in will run and the return will be
root@local/: helloworldscript
Hello world
root@local/:
You can do this by using links here's how you do it (I usually put my custom scripts in the /opt dir
ln -s /opt/scripts/helloworldscript.py /usr/bin/helloworldscript
So what's going on is that you're basically creating a symbolic link that the system can use as a command
ln - link command
-s - creates a symbolic link
/opt/scripts/helloworldscript.py - Specify the directory where the program is located( use the entire name of the program including extension)
/usr/bin/helloworldscript - the directory where it will be run (usr/bin is kinda like sys32 that's where commands are recognized from) and the name "helloworldscript" you can call the command whatever you like just as long as the directory and your /usr dir is correct.
Happyhunting ?


