I am using AWS EC2
along with the CodeStar services. I wanted to add the path to maven's binary to the PATH environment variable. So I wrote it to the /etc/environment
file and executed the command:
source /etc/environment
But it has now changed the default environment of the bash shell and now I am not able to execute any command. Even for a command like ls
it gives output -bash: command not found
How do I revert back to the default settings. I tried whatever my brain could think of. But nothing helped. Would be glad to hear from the community.
In order to revert back to the default settings:
As @Cyrus wrote you should update the PATH
variable
In the bash
shell run the following command:
PATH="/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin"
Undo the changes to the /etc/environment
/etc/environment
using the same method you used before, and remove the PATH line you added to the file You can use sudo vi /etc/environment
or any other editor you prefer
Note: In my AWS machine, the
/etc/environment
file is empty.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.