How to run a command as root?

时间:2017-10-11 09:21:07

标签: bash ubuntu su

How can I run a one-shot command as root? I expect this to work but its clear that I am misusing it.

other_user$ sudo su -lc "echo $(whoami)"
# => I expect "root" but get "other_user"

0 个答案:

没有答案