Command Prompt

A command prompt is part of a computer's text-based command line interface. The prompt appears as user and directory information following by a specific symbol and text cursor, indicating that the computer is ready for the user to enter commands. Most operating systems provide access to a command prompt as an alternative to its graphical user interface. Unix, Linux, and macOS users can access the command prompt using the Terminal app, while Windows users can access it by opening the Command Prompt utility, cmd.exe.

The command prompt often includes several pieces of important information. On Unix, Linux, and macOS, it starts with the username of the current user, followed by the computer name. After that, it includes the current directory where it will carry out commands; by default, the command prompt starts in the user's home directory, indicated by a ~ symbol. Windows formats its command prompt differently, omitting the user and computer name and starting with the full path of the current directory (including the drive letter). Finally, the command prompt ends with a symbol separating it from the commands the user enters, like a $, %, or >.

A typical Unix command prompt follows this pattern:

username@computername:/directory$

A macOS command prompt follows a similar pattern, but with spaces between elements:

username@Computer-Name directory %

Finally, the Windows command prompt remains the same as the DOS prompt:

C:\Users\Username>

Using the command prompt to issue commands requires memorization of some syntax and commands. While you can consult online guides or written documentation for commands that you won't use that often, it is still helpful to be familiar with at least some basic navigation commands. The cd command (used by Unix-based operating systems and Windows) lets you change the directory you're currently working in, either by entering a full path or a relative path from the current location. To see the files and folders within the current directory, you can use the ls command on Unix, Linux, and macOS, or the dir command on Windows.

Updated December 8, 2023 by Brian P.

quizTest Your Knowledge

ODBC allows applications to access different types of what?

A
Databases
0%
B
Operating systems
0%
C
Internet protocols
0%
D
Servers
0%
Correct! Incorrect!     View the ODBC definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Command Prompt on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.