Using sudo at the command line

To use sudo whilst using the command line (Applications → Accessories → Terminal), simply type sudo before the command you wish to run. Sudo will then prompt you for your password.

Sudo will remember your password for a set amount of time; by default this is 15 minutes, but can be changed. This feature was designed to allow users to perform multiple administrative tasks without being asked for a password each time.

To use a root terminal, type sudo -i at the command line.

To show a graphical password prompt, type gksudo at the command line, followed by the command you wish to run.

[Caution]

Be careful when using sudo; you might damage your system if you type the wrong command! As a general rule, only use sudo when absolutely necessary.