Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if RedHat Linux can't use ifconfig?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "RedHat Linux can not use ifconfig how to do", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "RedHat Linux can not use ifconfig how to do" this article.

Ifconfig is a command for Linux to display network devices, which can set the status of network devices, but in the RedHat Linux 5 system, it is sometimes encountered that the ifconfig command cannot be used. The following editor will introduce to you the solution that RedHat Linux 5 cannot use the ifconfig command. Let's go and have a look!

Use some commands on the terminal, such as: ifcinfig to check the local IP, and find that you cannot use this command and prompt "command not found". What should you do? think that the environment variable must not be loaded, then modify the environment variable as follows:

1. After the initial installation of the system, in order to make the system more secure, the path of some commands is not in the PATH environment variable. You can query it with the echo $PATH command. You can add the path to the PATH environment variable as follows:

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

(1) if you only want to temporarily add changes during this boot process, and the next boot is invalid, you can:

Enter export PATH=$PATH:/sbin

(2) if only the current user is permanently added, then:

Near the end of ~ / .bash_profile, there is a line like this PATH=$PATH:$HOME/bin and add: / sbin, it becomes PATH=$PATH:$HOME/bin:/sbin

After the file is modified and maintained, run the source ~ /. Bash_profile command to make the modification take effect immediately.

(3) if all users in the system are permanently added, then:

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 / etc/profile file [root@amdin007] # vi / etc/profile

Comment out the following if statement

# Path manipulationif ["$EUID" = "0"]; thenpathmunge / sbinpathmunge / usr/sbinpathmunge / usr/local/sbinfi

Modified to:

# Path manipulation#if ["$EUID" = "0"]; thenpathmunge / sbinpathmunge / usr/sbinpathmunge / usr/local/sbin#fi

Save and restart the system!

The above is the introduction of RedHat Linux 5 can not use the ifconfig command, this article introduces a total of two solutions, mainly by modifying the / etc/profile file, remember to restart the system after modification. I hope I can help you all!

The above is all the contents of the article "what to do if RedHat Linux can't use ifconfig". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report