Solve the problem that the ifconfig command in RedHat cannot be used
In RedHat, open the terminal and run the "ifconfig" command. If the prompt is "command not found", we can solve the problem as follows:
1. Enter the absolute path of the ifconfig command. ifconfig is under the/sbin directory. Therefore, run the following command on the terminal:
/Sbin/ifconfig
2. You can also modify the profile file and add the/sbin directory to the path. In this way, you can run this command without entering an absolute path, regardless of the directory. The method is as follows:
A. Open the/etc/profile file with the root permission:
VI/etc/profile
Add the following code to the last line of the file, save the file, and exit.
Export Path = $ path:/sbin
Run the following commands on the terminal:
Source/etc/profile
Then enter "ifconfig" to run the command directly.
This article is from the "kingdba" blog, please be sure to keep this source http://kingdba.blog.51cto.com/801693/1539425