When I log in as root
and enter some random non-existing command, it says:
root@localhost:~# asdf
-bash: asdf: command not found
root@localhost:~#
But when I do the same thing as user rakinar2
it says:
rakinar2@localhost:~$ asdf
bash: asdf: command not found
rakinar2@localhost:~$
Now what are difference between -bash and bash?
sudo
,sudo -i
would start a login shell. Terminal emulators and stuff likescreen
usually probably start non-login shells, unless you've configured them to start login shells... – ilkkachu Aug 07 '21 at 14:51sudo su
to log in as root... – Ar Rakin Aug 07 '21 at 14:53