Siddhartha
Siddhartha

Reputation: 4464

Su v/s Sudo on Mac

I was trying to create a symlink to the sublime exe file from the sublime package to usr/bin using su:

su ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/bin/

but it gave me an error:

su: Sorry

It seems to work when I use sudo. As far as I was aware (I might be wrong), su switches to root user, whereas sudo runs a command from root user perspective but doesn't switch to it..In that case shouldn't both work?

Upvotes: 0

Views: 118

Answers (1)

AMADANON Inc.
AMADANON Inc.

Reputation: 5919

su takes options of it's own, to run a command, try su -c <command>

Upvotes: 1

Related Questions