Skip to main content
Skip table of contents

How to work with a command prompt

You may need to perform command-line tasks to help diagnose problems or perform certain commands, such as uninstalling a database server or changing permissions. This article gives instructions for how to access the command prompt for various operating systems.


Use the terminal...

Opening the terminal

  1. Click the Spotlight icon in the upper right-hand corner of the screen 
    Spotlight icon on 10.10 Yosemite
  2. Begin typing Terminal until you see the Terminal application appear in the search results
    Spotlight on OS X 10.10 Yosemite
  3. Press Return to open the Terminal application
  4. A new terminal window will appear
  5. Type commands and press Return to execute them

Running commands as an administrator

Commands that require administrative rights begin with the word sudo. The first time you enter a sudo command you will be prompted to enter the Mac OS X user's password.


Not all macOS users have administrative rights. You might need to log into the computer as a different user to run sudo commands.

As you type the password you won't see anything change on the screen. This is a security feature, and rest assured your password is being received.

Press Return and the command will execute with administrative rights. If you mis-typed the password, you will see a message asking you to re-enter the password:

Sorry, try again.

Once you've authenticated with administrative rights you can run further commands using sudo without the need to re-enter the password. If you go five minutes without entering a command, however, you will need to re-enter your password for the next sudo command.

Closing the terminal

  1. Type exit
  2. Press Return
  3. Quit the Terminal application


Use the command prompt...

Opening the command prompt

  1. Press the Windows key or click Start
  2. Type cmd.exe
  3. Press Enter

  4. The command prompt will open
  5. Type commands and press Enter to execute them

Running commands as an administrator

In Windows, you must open the command prompt as an administrator to run commands that require administrative rights. You cannot switch from a standard command prompt to an administrative command prompt, although you can have both open at once.

  1. Press the Windows key or click Start
  2. Start typing cmd.exe
  3. Right-click cmd.exe in the search results and choose Run as Administrator
  4. Some installations of Windows may require you to authenticate either by clicking an Allow button or entering a username and password

  5. A command prompt will open. Note the window title indicates this command prompt is being run as an administrator
  6. Any commands entered in this window will be executed as an administrator

Closing the command prompt

Type exit and press Enter to close the command prompt.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.