Aliases are personal tools
- I think aliases are intended for personal use (and should reside in each user's
Shellscripts (and other programs) are general tools
This is my path in Lubuntu 18.04.x LTS.
$ echo $PATH
I have an own
bin directory, which is automatically found and put in the beginning of the path (with highest priority). But the rest of the path is standard.
I would suggest that you
check that there should be no conflict with the name
type unique-name # shows if it exists and what kind of program it is
which unique-name # shows where an installed program is stored
unique-name # if known but not installed, you get a hint about it
apt-cache policy *unique-name* # package name (may or may not be same as program name)
if no conflict, create a shellscript (this is a trivial example)
echo 'echo "Hello World"' > unique-name
make the shellscript executable
chmod +x unique-name
put the shellscript into
/usr/local/sbin if it needs root privileges or otherwise into
sudo cp -i unique-name /usr/local/bin
-i prompts you if the name already exists in the target directory.
How all users can run your shellscript
When you make the shellscript executable and it is in a directory in everybody's
PATH, everybody can run it via its file name,
There are several short strings that are not yet used as names for standard programs, and you can find such names by testing with
$ type py
bash: type: py: not found
In my computer there is no executable program and no shell built-in with that name, so I can use
py as a file name (and I need no alias).
But if you try to run
py before renaming your shellscript to that name,
Command 'py' not found, but can be installed with:
sudo apt install pythonpy
you will find that there is such a program (but it is not yet installed), and it might be a good idea to select another name, for example
which can be a short name derived from your original name PyCharm.