Specifications

Commands Requiring Root or Administrator Privileges
Many commands used to manage a server must be executed by an administrator user
or the root user. For example, entering:
server:~ mariah$ shutdown
gives you the following error:
shutdown: NOT super-user
This is because the shutdown command can be run only by the root user or by an
administrative user with special privileges. To run commands in this "super user” mode,
use the sudo command. sudo stands for “super user do.” The following command does
work, (so don’t run it unless you really want to restart your computer):
server:~ mariah$ sudo shutdown
You’ll be prompted for the password of the currently logged in user. Only users that
you have designated as admin users are able to execute commands with sudo. If you’re
logged in as a user who isn’t an admin user, you can change “substitute users” by
typing su adminUsername, where adminUsername is the name of a user in the Admin
group. After you enter that users password, a new shell is launched from the existing
shell, as that user. If a command requires it, you can use su to log in as the root user.
Under normal circumstances you don’t need to use the root user account. If you do su
to the root user, be especially careful, as you have sucient privileges to make changes
that can cause your server to stop working.
For more information about the sudo and su commands, see their man pages.
Getting Help for Command-Line Tools
Command-line tools provide multiple mechanism for getting help while using them.
This section describes three ways that you can get help from the command-line.
Using Help Built Into Command-Line Tools
Most command-line tools include a parameter to invoke onscreen help directly.
Command-line tools do not always follow the same conventions so if one parameter
doesn’t work try another.
To access command help:
Enter the command followed by the -help,-h,--help, or help parameter:
$ hdiutil help
$ dig -h
$ diff --help
16 Chapter 1 Introduction to the Command-Line Environment