Sudo
EXAMPLES
To get a file listing of an unreadable directory:
$ sudo ls /usr/local/protected
To list the home directory of user yazza on a
machine where the file system
holding ~yazza is not exported as root:
$ sudo -u yazza ls ~yazza
To edit the index.html file as user www:
$ sudo -u www vi ~www/htdocs/index.html
To shutdown a machine:
$ sudo shutdown -r +15 "quick reboot"
To make a usage listing of the directories in the /home partition.
Note that this runs the commands
in a sub-shell to make the cd and file redirection work.
$ sudo sh -c "cd /home ; du -s * │ sort -rn > USAGE"