I have a bin folder with a bunch of sh files. For example "server-run.sh", "server-stop.sh", "server-do-something.sh". And I want to run file "server-stop.sh" from anywhere. I could add this bin folder to path but "run" and "do-something" files also will be available and I don't want to pollute my console. Also I don't want to add this file to /bin folder, because it could change. Maybe link. Can I somehow add only "server-stop.sh" to path?
Add to Path Only SH File – Command-line Bash Execution
bashcommand lineexecute-command
Best Answer
The best way is to add a symbolic link to this file in the
/usr/local/bin
directory:In this case, you are adding a link to the original file, so you can always change the original file and you command will always be working.