Ubuntu – I permanently changed the PATH variable by mistake, and I am unable to login now. How to change the PATH variable to default

bashcommand lineenvironment-variables

I used sudo -H gedit /etc/environment command on terminal to permanently change my PATH variable.

To correct it, I pressed Ctrl+Alt+F1, and used export PATH command, but access was denied.

Many commands (including sudo and nano) are not recognized as the new PATH variable doesn't have /usr/bin. I am new to Linux commands.

How can I fix this?

Best Answer

/usr/bin/sudo /bin/nano /etc/environment
Related Question