Today, the early adopters with VMware installed CentOS7, selected the minimum installation package mode, after installation to check the IP address of the machine, found an error
?
?
1 |
- bash : ifconfig : command not found |
Google a bit, sorted out a solution to the idea
To see if the ifconfig command exists
See if/sbin/ifconfig exists
If the ifconfig command is present, view environment variable settings
?
If the environment variable does not contain a path that contains the Ifconfig command
temporarily Modify environment variables: Enter in shell
?
1 |
$ export PATH = $PATH: /sbin |
Then enter the Ifconfig command, but this only temporarily changes the path in the shell, if the shell is closed, the modification disappears, the next time you need to repeat the action
permanently modify the path variable to include the/sbin path:
Open the/etc/profile file, where you can enter export path= $PATH:/sbin, save and restart X, so that the path path is permanently modified to succeed, and at any time only the order Ifconfig command can be
3. If the ifconfig command does not exist
?
?
This article from "Knowledge change destiny!!" "blog, declined reprint!"
CentOS 7 ifconfig Command not found solution