What can I do if RedHat Linux 5 cannot use ifconfig?

  
                

ifconfig is a command for Linux to display network devices. It can set the status of network devices. However, in RedHat Linux 5 system, sometimes the ifconfig command cannot be used. The following small series will introduce you to RedHat Linux 5. Use the resolution of the ifconfig command.

Use some commands in the terminal, such as: ifcinfig view the IP of the machine, use this command can not be found, suggesting that & ldquo; command not found & rdquo ;, then think about how to do this is certainly an environment variable If it is not loaded, then modify the environment variable, modify it as follows:

1. After the initial installation completes the system, the system is safer. Some commands are not in the PATH environment variable. You can use the echo $PATH command. The query knows that the way to add the path to the PATH environment variable is as follows:

(such as adding /sbin to the PATH environment variable)

(1) If you only want to temporarily install this boot process Sexual additions and modifications, if the next boot is invalid, you can:

Enter export PATH=$PATH:/sbin

(2) If you only add the current user permanently, then:

In the ~/.bash_profile near the end of a line like PATH=$PATH:$HOME/bin, add: /sbin, it becomes PATH=$PATH:$HOME/bin:/sbin

After the file is modified and kept, run source ~/.bash The _profile command will make the modification take effect immediately.

(3) If all users in the system are permanently added:

Add export PATH=$PATH:/sbin

at the end of the /etc/profile file. After the file is modified and kept, run the source etc/profile command to make the modification take effect immediately.

2, there is a solution

[root@admin007]# /sbin/ifconfig

or modify the /etc/profile file

[ Root@amdin007]# vi /etc/profile

Comment out the following if statement

# Path manipulation

if [ “$EUID” = “0” ] ; then

pathmunge /sbin

pathmunge /usr/sbin

pathmunge /usr/local/sbin

fi

:

# Path manipulation

#if [ “$EUID” = “0” ]; then

pathmunge /sbin

pathmunge /usr /sbin

pathmunge /usr/local/sbin

#fi

Save, restart the system!

The above is the method that RedHat Linux 5 can't use the ifconfig command. This article introduces two solutions, mainly by modifying the /etc/profile file, and remember to restart the system after modification.

Copyright © Windows knowledge All Rights Reserved