I want to learn how to add and remove a directory/file from the PATH but there are hundred answers and a lot of them are contradictory (or so I believe).
I have found answers that suggest editing .profile
and others that say that this file is no longer supported for this job (or that is what I understand).
I have found answers that suggest editing /etc/environment
.
Some other answers suggest editing '~/.bashrc' file.
Also I have found some answers suggesting writing something like export PATH=...
Currently I don't know which of these suggestions are correct, which of them are advisable to be used without causing any side effects in my system and I haven't got any idea hot to remove a directory/file from the PATH.
So how can I add and remove a directory/file from the PATH correctly?