After installing RedHat Linux 5, I run some commands on the terminal, for example, ifcinfig, to check the IP address of the local machine, and found that the command cannot be used, prompting "command not found ", what should I do? Think it must be that the environment variable is not loaded. Then, modify the environment variable as follows:
1. After the system is initially installed, the PATH of some commands is not included in the path environment variable for higher security. You can use the echo $ PATH command to query and learn, to add a PATH to a PATH environment variable, follow these steps:
(For example, add/sbin to the path environment variable)
(1) If you only want to add temporary modifications during the current Boot Process, the next boot will be invalid, you can:
Enter export PATH = $ PATH:/sbin
(2) If only the current user is permanently added:
In ~ /. There is a line similar to this PATH near the end of bash_profile = $ PATH: $ HOME/bin and then add:/sbin, it becomes PATH = $ PATH: $ HOME/bin:/sbin
Run source ~ The/. bash_profile command takes effect immediately.
(3) If all users in the system are permanently added:
Add export PATH = $ PATH:/sbin at the end of the/etc/profile file
After the file is modified and maintained, run the source etc/profile command to make the modification take effect immediately.
2. There is another solution.
[Root @ admin007] #/sbin/ifconfig
Or modify the/etc/profile file.
[Root @ amdin007] # vi/etc/profile
Comment out the following if statement
# Path manipulation
If ["$ EUID" = "0"]; then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
Fi
To:
# Path manipulation
# If ["$ EUID" = "0"]; then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
# Fi
Save and restart the system!
After the system is started, try using the command on the terminal to see if it has taken effect.