That is a nice question. Most of the folks coming from windows background have this question.
Sudo is a alternative command to the earlier su command that needs a root password which most administrators are not happy to share with. The general purpose of su is to do administrative tasks without leaving the current logged in user.
Sudo has the similar function except on the other hand brings easy of use without trading root password. Also it has the following additional features
- Sudo can be limited to a certain list of commands. What that means is a admin can restrict the commands that can be used alongwith sudo command
- All command executions through sudo can be logged
- A different password can be assigned to sudo without trading root password
- Sudo execution can also be limited to limited users
Syntax: sudo <command> and it will prompt for sudo password