Repairing a User’s Path in Linux
A problem can occur in Linux when the $PATH variable is incorrectly set, which prevents any commands from being found.
To fix this problem, follow these steps:
- Have the user log in to remote.eos.ncsu.edu via PuTTY.
Above the eos$ prompt, it will say:
-bash: quota: command not found
-bash: uname: command not found - Enter ls. It will say:
-bash: ls: command not found
Note: Everything until this point proves that the $PATH is incorrectly set. So you need to copy a good $PATH from someone else’s profile. - Open another instance of PuTTY, log in to PuTTY as yourself, then echo $PATH and copy the resulting line into the clipboard.
- Going back to the user’s instance, type eos$ export PATH= and then paste the copied line.
- Enter echo $PATH again to ensure that $PATH is set correctly.
- Edit the .bashrc and .mybashrc files using vim to make sure the proper $PATH is there.
eos$ vim .mybashrc