A command-line interface (CLI) is an alternative to graphical apps for interacting with and controlling your computer.
For common OS X Server administration tasks, you can use the Server app. However, there are situations where using the command-line interface (CLI) instead might be appropriate, including:
Configuring advanced options that aren’t supported by the Server app
Configuring remotely from a computer that doesn’t have the Server app installed—for example, a computer with Windows, Linux, or another UNIX-based operating system
Performing tasks that are repetitive or that must be run at predefined times
Editing text files, usually to change advanced configuration settings and preferences
The primary way to access the CLI in OS X Server is with the Terminal app. Each window in Terminal contains an execution context, called a shell, which is separate from all other execution contexts.
The shell is an interactive programming language interpreter, with a specialized syntax for executing commands and writing structured programs (shell scripts). Different shells have slightly different capabilities and programming syntax.
In UNIX-based operating systems, the foundation upon which OS X and OS X Server are built, the shell is the fundamental user interface. The shell environment presents users with a text prompt, and accepts keyboard input.
The shell is easily accessed through Terminal, but there are other options. The shell can be invoked interactively, or by a text file with commands to the shell given in a standard format.
There are several shells available in OS X, include bash
, csh
, ksh
, sh
, tcsh
, and zsh
, each with its own strengths and capabilities. Although you can use any shell, the examples in this guide use bash
, the startup shell for OS X, and the default user shell.
For information about these shells, see their man pages.