Why cannot I use the ifconfig command in RedHat Linux 5?

Source: Internet
Author: User

After installing RedHat Linux 5, I run some commands on the terminal, for example, ifcinfig, to check the IP address of the local machine, and found that the command cannot be used, prompting "command not found ", what should I do? Think it must be that the environment variable is not loaded. Then, modify the environment variable as follows:

1. After the system is initially installed, the PATH of some commands is not included in the path environment variable for higher security. You can use the echo $ PATH command to query and learn, to add a PATH to a PATH environment variable, follow these steps:

(For example, add/sbin to the path environment variable)

(1) If you only want to add temporary modifications during the current Boot Process, the next boot will be invalid, you can:

Enter export PATH = $ PATH:/sbin

(2) If only the current user is permanently added:

In ~ /. There is a line similar to this PATH near the end of bash_profile = $ PATH: $ HOME/bin and then add:/sbin, it becomes PATH = $ PATH: $ HOME/bin:/sbin

Run source ~ The/. bash_profile command takes 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 maintained, run the source etc/profile command to make the modification take effect immediately.

2. There is another 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

To:

# Path manipulation

# If ["$ EUID" = "0"]; then

Pathmunge/sbin

Pathmunge/usr/sbin

Pathmunge/usr/local/sbin

# Fi

Save and restart the system!

After the system is started, try using the command on the terminal to see if it has taken effect.

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.