I have used linux:Kali
for a while and to get root access i just needed to type: su
in terminal. But in OSX i need to type in su -
what does this -
mean?
If i just type su
in terminal than i get sh-3.2#
in next line
whereas if i type su -
then i get root#
in next line.
What's the difference between all of these commands.
Also i see some other commands to get root access in terminal:
(1) su bash
(2) sudo su
Please help to understand difference b/w all these commands.
Best Answer
From
man su
:As for
su
versussudo
, it's generally accepted in Apple circles thatsudo
is the preferred method of working in root. By default,su
is disabled on OS X (as is the root account). There are only a few occasions when I've had to enable root to get things done.For more information, I recommend reading both manpages.
man su
man sudo