Fedora system ifconfig and netstat command can not find a solution

  

Fedora is a kind of Linux system, most of the operations also need commands to complete, there are users reflected in the Fedora system using ifconfig, netstat command, Found that these two commands can not be found, the following small series will introduce the solution.

If the following problems:

[root @ thunderspeed ~] # ifconfig

bash: ifconfig: command not found .. .

[root@thunderspeed ~]#

[root@thunderspeed ~]# netstat

bash: netstat: command not found. .

[root@thunderspeed ~]#

Analyze the problem

1.whereis ifconfig See which directory this command is in

2.echo $PATH Look at the directory is under the path, pay attention to the lunux is completely case-sensitive, so do not ignore this

3. Execute the command, you need to specify the path or add the directory to the PATH

So you can access

Method 1: [root@localhost sbin]$ /sbin/ifconfig can be used

Method 2: [root@localhost sbin]$ export PATH=$ PATH: /sbin, after this setting, you can directly access the next time, to avoid the first kind of trouble, such as:

[root@localhost /]$ ifconfig

Modify /etc /profile file, comment out the if statement

Comment out the following if statement:

# Path manipulation

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

pathmunge /sbin

pathmunge /usr/sbin

pathmunge /usr/local/sbi n

fi

Modified to

# Path manipulation

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

pathmunge /sbin

pathmunge /usr/sbin

pathmunge /usr/local/sbin

#fi

If it doesn't work, you may need to install it Use proves to search for dependencies

sudo yum provides ifconfig

The search results are: net-tools So you need to install the net-tools package

sudo yum install net-tools

Save, restart

The above is the way Fedora can't find the ifconfig, netstat command. If you can't solve the problem through the method described in this article, you can try to reinstall the two. command.

Copyright © Windows knowledge All Rights Reserved