If the following problem occurs:
[Root@thunderspeed ~]# Ifconfig
Bash:ifconfig:command not found ...
[Root@thunderspeed ~]#
[Root@thunderspeed ~]# netstat
Bash:netstat:command not found ...
[Root@thunderspeed ~]#
Analyze problems
1.whereis ifconfig look at this command in which directory
2.echo $PATH look at whether the directory is under the path and note that the lunux is completely case-sensitive, so don't overlook this
3. Execute command, need to specify path or add directory to path
So you can access this
Method one: [Root@localhost sbin]$/sbin/ifconfig can appear using the
Method Two: [Root@localhost sbin]$ export path= $PATH:/sbin, this setting, the next time you can directly access, to avoid the first kind of trouble, such as:
[Root@localhost/]$ Ifconfig
Modify the/etc/profile file and comment out the IF statement
Comment out the following if statement:
# Path Manipulation
If ["$EUID" = "0"]; Then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
Fi
Amended to
# Path Manipulation
# if ["$EUID" = "0"]; Then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
#fi
If it's not working, you may need to install it. Using the provides search dependency pack
sudo yum provides ifconfig
Search results are: Net-tools therefore need to install Net-tools package can
sudo yum install Net-tools
Save, reboot