## Command Line Interface

If you think about how you usually use a computer, you probably navigate to a file by clicking on directories and open a program or file by double clicking on them. When you are programming a computer, you often need to run programs and send them options, called arguments, which is nearly impossible to do with only a click.

Because of this, every operating system contains a Command Line Interface (CLI) that lets you interact with your computer using a keyboard. You can do everything you already do on a computer via the command line, but you can also do a whole lot more!

### Windows: Opening your command line

• Press [Windows Key] to bring up the “Windows menu”
• Type: Anaconda Prompt
• Press [Enter]
• A black box titled “Anaconda Prompt” will open

### Mac OS X: Opening your command line

• Press [Command]+[Space] to open Spotlight, or open up Spotlight or App Launcher
• Type: Terminal
• Press [Enter]
• A white box titled “Terminal” will open

## Command prompt

Both command line tools start every line with a prompt that shows the current working directory of the command line tool. By default, both Windows and Mac starts you off in the base folder for your user account. The syntax varies only slightly between the two (assuming a user named Karle), so the initial prompt should be one of the following:

• Windows: C:\Users\hknguyen\>

### Useful Command: Listing Files

When using a command line tool, you often want to know what files are in your current working directory. To list all files in the current directory:

• Windows: dir
• OS X: ls

### Useful Command: Moving Up a Directory

In addition to moving “forward” or “deeper” into your directories, the special cd .. will change your directory “up” one directory.

• Moves into stat430 from your Desktop (one level deeper): cd stat430
• Moves back to your Desktop from stat430 (one level shallower): cd ..

Modified from Wade Fagen-Ulmschneider & Karle Flanagan’s STAT 107 - Fall 2019 guide with permission.