Solve the problem that ifconfig command cannot be used in RedHat

In RedHat, open the terminal, run the "ifconfig" command, if the prompt is "command not found", we can solve it by the following methods:
1. Enter the absolute path of the ifconfig command, ifconfig is /sbin this Below the directory, so you can run this command by entering the following command in the terminal:
/sbin/ifconfig
2. We can also modify the profile file and add the /sbin directory to the PATH, so that no matter in a directory, you don’t need to enter the absolute path. You can run this command as follows:
a. Open the /etc/profile file with root privileges:
vi /etc/profile
Add the following code to the last line of this file, then save the file and exit.
export PATH=$PATH:/ sbin
Run the following command in the terminal:
source /etc/profile
and then type "ifconfig" to run this command directly.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326220139&siteId=291194637