Fedora Ifconfig,netstat Command not found

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.