This site requires JavaScript to be enabled

Repairing a User’s Path in Linux

331 views

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:

1. 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

2. 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.

3. Open another instance of PuTTY, log in to PuTTY as yourself, then echo $PATH and copy the resulting line into the clipboard.

4. Going back to the user’s instance, type eos$ export PATH= and then paste the copied line.

5. Enter echo $PATH again to ensure that $PATH is set correctly.

6. Edit the .bashrc and .mybashrc files using vim to make sure the proper $PATH is there.

eos$ vim .mybashrc