Bash: ifconfig: Command not found

Source: Internet
Author: User

What is the problem with ifconfig? The system prompts that the image cannot be found ~~ So Baidu ~~


[[Email protected]/] $ ifconfig
Prompt: "Bash: ifconfig: Command not found"

Switch to the root user
[[Email protected]/] $ ifconfig
Still prompt: "Bash: ifconfig: Command not found"

Analyze problems
1. whereis ifconfig: Check the directory in which the command is located.

2. Echo $ path: Check whether the directory is in the path. Note that lunux is case-sensitive, so do not ignore this.

3. to execute the command, you must specify the path or add the directory to the path.

4. You can access
Method 1: [[email protected] sbin] $/sbin/ifconfig
Method 2: [[email protected] sbin] $ export Path = $ path:/sbin. After this setting, you can directly access it next time, avoiding the first type of trouble, such:
[[Email protected]/] $ ifconfig

Method 3: 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
Change
# Path manipulation
# If ["$ EUID" = "0"]; then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
# Fi

Note: not only does the ifconfig command show "Bash: ifconfig: Command not found" because the path of a non-root user does not contain/sbin/ifconfig
Other commands can also be used in this case. The solution is the same.

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.