This works on macOS, Linux, and Unix-like

in .basrc or .zshrc (hidden files) (They are configuration files for the zsh and bash shells) located in the home directory (~)
A console/terminal/tty is just a visual component that sends commands to the shell so they can be processed

you must modify the content
First you must create a home directory, where you can place your executables.


The idea is to call the executable “a” from the terminal/console/tty just by typing “a” and from anywhere
For this you must add your home directory to the $PATH environment variable
your home directory contains executable files
that you would normally execute:
./file_name
or with arguments
./file_name arg1 arg2
The PATH is a list of directories where the shell automatically searches for executables
Best practice for personal or development binaries is to place them in the ~/bin or ~/local/bin directory
You generally cannot copy executables to the /bin or /sbin directories (except with root permissions)
Now you need to tell your shell to include your new directory in the list of directories it searches.
export PATH=$PATH:$HOME/personal-directory
It is a colon (:) followed by the environment variable $HOME (indicates your user’s home directory) and the new directory you created in ~
That is, $PATH takes the directories that $PATH already has and adds a new one with two dots (:)
The system will know to look for leibnix in ~/personal-directory
When you open a terminal or command prompt and type a command like python, the operating system needs to know where to look for the executable file (python.exe on Windows or simply python on Unix/Linux/macOS systems) in order to run it.
The system begins to check, in order, all the folders that are listed in the PATH environment variable
The moment it finds a file called python (or similar) in one of those folders, it runs it
reload .bashrc or .zshrc to take the new settings
source ~/.zshrc
would be the keyword “source” ssfollowed by the address of the .zshrc or .bashrc
When you open a new terminal/console/tty or start the operating system, “source” is automatically executed.
When you write:
python x.py
The system searches for the python command through the PATH
Once you locate the Python executable (for example, in C:\Users…\AppData\Local\Programs\Python\Python310), launch it.
You pass the argument x.py to the Python program, and it executes the script.
birds home directories in ~ or . don’t work in $PATH for security