This question already has an answer here:
I thought that running a command with
sudo was identical to logging in as the root user and executing the command. However I have found a few commands that do not work with
sudo but do work for
sudo > mail.log bash: mail.log: Permission denied
but actually typing
su and executing the same command works.
Why is this?