Fix a Broken $PATH So Commands Work Again
The laborant user's ~/.bashrc has been modified and now sets a broken $PATH, causing standard commands like ls, cat, and id to fail with command not found in every new shell session.
Fix the PATH permanently so that:
- Standard system commands (
ls,cat,id, etc.) work in new shell sessions /usr/binand/usr/sbinare present in$PATH- The fix persists across logins (i.e., survives opening a new terminal)
Complete the task on rocky-01 as the laborant user.
Hint 1 — Where to look
Shell environment variables set at login come from configuration files in the user's home directory. Start by examining what's in ~/.bashrc.
Hint 2 — Diagnosing the problem
Run echo $PATH in your current session. If you see only /home/laborant/bin or similar, the PATH has been overwritten. Look for a line near the bottom of ~/.bashrc that starts with export PATH=.
Hint 3 — Fixing the PATH
Remove or edit the broken export PATH= line in ~/.bashrc. A healthy Rocky Linux 9 PATH for a regular user looks like:
/home/laborant/.local/bin:/home/laborant/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
You can restore it with:
export PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:$HOME/.local/bin:$HOME/bin
Then make it permanent by updating ~/.bashrc.