Commandisnotfound self-help Method for modifying/etc/profile in Linux
The bash command cannot be used after the blogger modifies the/etc/profile configuration file method.
The result of executing the ls command is as follows:
-Bash: ls: command is not found
Fortunately, the blogger backed up the/etc/profile, so I restored the profile through SSH, but now I need to execute
# Source/etc/profile
Make the configuration file take effect again. Unfortunately
-Bash: id: command is not found
The source command is unknown!
After being mentioned by Du Niang, we can use the command to re-use the PATH;
# Export PATH =/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
After executing the preceding command, you can re-execute the source/etc/profile command to make your configuration file take effect.
If your profile configuration file is not backed up, you can add the command address before vi if you cannot use the vi command directly.
#/Bin/vi/etc/profile
In this way, you can use the vi command to modify it!