A command interpreter is a type of program that performs a prompt-read-execute cycle. That is:
- The program displays a prompt, indicating that it is ready to receive input.
- The program reads a line of command input from the user.
- The program performs the actions described by that command.
- And repeat as necessary.
A command interpreter can form the user interface for an operating system. In that case, the commands read and executed usually correspond to programs to be run. Examples of this type of command interpreter, frequently known as a command line interface or CLI, include:
- the plethora of shells available for Unix-like operating systems, including sh, csh, bash, and their kin
- the COMMAND.COM program that is part of most versions of MS-DOS and related systems, including Windows versions since 95
- the CMD.EXE program that is part of OS/2 and NTish versions of Windows
Not all command interpreters read input from a user: some read input from a file. Both the DOS command interpreter and Unix shells can read input from either. If the input is from a file, rather than from an interactive source, the output of the prompt is precluded.
Not all command interpreters form front-ends of operating systems. For example, most implementations of the programming language LISP use a command interpreter for testing and development purposes. The Unix client of FTP uses a command interpreter to provide interactive manipulation of remote files.