A command interpreter is a type of program that performs a prompt-read-execute cycle. That is:

  1. The program displays a prompt, indicating that it is ready to receive input.
  2. The program reads a line of command input from the user.
  3. The program performs the actions described by that command.
  4. 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.

Log in or register to write something here or to contact authors.