Tuesday 12 March 2019

linux - How do I log out of `sudo su`?


I'm using sudo su to start mysql and do some homework with it.


When I finish with mysql (or any other command), then I'm still in sudo.


How do I "log out", so my prompt changes back from # to $?



Answer



You don't need to use sudo and su together--su switches your user account (without arguments it switches you to root). sudo just elevates your privileges to root for the current command.


It's reccomended to use sudo instead of su if possible, but to return to your normal account after calling su, simply use the exit command


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...