In Linux or UNIX shell (which is used on all of our UQAM servers as well on Compute Canada servers), an alias is a shortcut that references one or several commands. The syntax is:
alias name_of_alias='command(s)'
To put several commands in the same alias separate them by semicolons - see blue example below.
The command:
alias
shows you all existing aliases. Just try it out.
You can create your own personal aliases, exports etc. for interactive use and put them in the file
~/.profile.d/.interactive_profile
which you will have to create if it does not exist already. They will be available to you after the next login or after you sourced the above file. Note, they are only available in interactive sessions (in a window) but not when you submit a script in batch (in the background).
It is not recommended to load any modules or to execute any '. s.ssmuse.dot' commands in this file because some of them do not get along. Meaning if one module is loaded some other tools might not work anymore. If you do decide to load any modules automatically anyway and some other tool is not working, comment all automatic load(s) in the above file, open a new window and try the tool that did not work again.
Instead of loading modules automatically I suggest to create aliases. For example, if you frequently want to read RPN files with Python3 you could create the following alias in the above file:
alias py3='module load python3/miniforge3; module load python3/python-rpn; module load python3/outils-divers; source activate base_plus'
Then all you have to do if you want to use Python is to execute the "command" (alias): py3
Ajouter un commentaire