I just learned about Linux, A cainiao, and I don't know anything. I enter ifconfig in the terminal to view the network configuration information, but the ifconfig command cannot be found. Then I can switch to root. I have had an interview on wubantu. What is the problem? I checked it online because no environment variable was added. The ifconfig command exists in/sbin. Use echo $ path to view the normal user environment variables without/sbin.
There are several ways to add environment variables to different places on the Internet. There is a temporary one, and it will lose effect after exiting the terminal. And long-lasting. One of these methods is to modify the/etc/profile file. This method is used.
Switch to the root permission and modify the profile file.
Su-Root
Gedit/etc/profile
Add export Path = "/sbin: $ path" at the end of the file, save and exit.
Log out of logout as the root user and switch to the common user.
If no error is reported for source/etc/profile, the execution is successful.
Ifconfig displays the network configuration information again, indicating that the modification is successful.