su, the most useless Unix command
I once tweeted my stance on
suis officially useless. And to wean oldtimers off of it, I plan to
ln -f /bin/halt /bin/su.
- For interactive switching of users, you can use
sudo -sfor a normal shell, or
sudo -ifor a login shell. Add a
-u foobarto switch to user
foobarinstead of root.
- For setting the user to run a daemon or some other process under when you’re already root (e.g., if you’re running a daemon in an init script or a service),
setuidgidis simple and just works.
For me, seeing people use
sudo su ... is akin to seeing code like
if (foo) return true; else return false;. It makes me twitch every time. And there’s still so many online resources out there that promulgate it! I think a reeducation campaign is in order. :-D
 I think
su is still useful for rooted Android devices.