Centos 7 ifconfig
Prompt-bash: ifconfig: command not found when running ifconfig in CentOS 7
Today, I have installed CentOS7 with VMWare and selected the minimal installation package mode. After installation, I want to check the local IP address and find an error.
# Ifcon
-Bash: ifconfig: commandnotfound
Google sorted out the solution
Check whether/sbin/ifconfig exists
Check whether the ifconfig command exists
If the ifconfig command exists, check the environment variable settings.
# Echo $ PATH
If the environment variable does not contain the path of the ifconfig command
Temporary environment variable modification: Enter
$ ExportPATH = $ PATH:/sbin
Then enter the ifconfig command, but it only temporarily changes the PATH in the shell. If the shell is closed, the modification disappears and the above operation needs to be repeated next time.
Permanently modify the PATH variable to include the/sbin PATH:
Open the/etc/profile file, enter export PATH = $ PATH:/sbin, save and restart X. In this way, the PATH is permanently modified, at any time in the future, you only need the ifconfig command in the book order.
3. If the ifconfig command does not exist
Yumupgrade
Yuminstallnet-tools