On Sat, May 21, 2022 at 11:12:01AM +0000, Lee wrote: > On 5/19/22, Tom Browder <tom.brow...@gmail.com> wrote: > > On Thu, May 19, 2022 at 03:54 Kamil Jońca <kjo...@o2.pl> wrote: > > > >> It is quite misterious for me. > >> What is the purpose of "sudo su" instead of plain "sudo" or "sudo -i" > < .. snip ..> > > > > I have for years now not used the many variants of su, just "sudo" alone > > for one-off use and "sudo su" when I'm doing several things as root. > > Why not "sudo bash" when you want to do several things as root?
Well, that's what sudo -s and sudo -i do; only that they are smarter than this and choose "your" (for one of several possible values of "your") favourite shell (be it bash or other). Straight from the man page: -i, --login Run the shell specified by the target user's password database entry as a login shell. This means that login-specific resource files such as .profile, .bash_profile or .login will be read by the shell [...] -s, --shell Run the shell specified by the SHELL environment variable if it is set or the shell specified by the invoking user's password database entry [...] Kids, read the man page ;-) Less typing, more general. Nobody's trying to dissuade you of doing "sudo bash" or "sudo su" or... (hey, let's play Rube Goldberg a bit) "sudo perl -e 'system(bash)'". But most, most of the time, sudo -i or sudo -s will do what you want. Cheers -- t
signature.asc
Description: PGP signature