4 ms·
Simply `su` should not change the PATH; you have to start a login shell, as in `su -`.
by Crestwave 7y ago
Simply `su` should not change the PATH; you have to start a login shell, as in `su -`.
- charlesdaniels 7y agoHuh. I guess I just never noticed that... normally I do `sudo su`, which I believe does update PATH.
- minitech 7y agosudo tip: `sudo -i`!
- fiddlerwoaroof 7y agoYeah, sudo su always annoys me: sudo -i if you want a login shell and sudo -s if you don’t (e.g. you cd-ed somewhere and forgot to become root, but don’t want to cd again because the path is long or you have done some complicated setup.
- thresh 7y ago"sudo su" is "launch su with superuser privileges", which is eh... weird to say the least. You probably wanted "sudo -i".