0 Index1 Preparation2 Install3 Input4 Run5 What6 Discussion7 Play8 Share9 Presentation

Terminal

The Terminal is a computers most basic interface where you only can do text commands and recieve text output. On a Mac you find your Terminal by typing Terminal into the Spotlight search.

An Terminal tutorial from a previous H&D event can be found here.

Using your keyboard

left right Navigate through command string. Hold alt to jump over words.

up down Reuse previous commands.

enter Execute command.

ctrl c Stop and exit a running program instead of closing the window.

Running a python program

To run a python program, you first start the python interpreter and then tell it which program to run.

$ python my_program.py

It is possible, that the previous command will use python 2.7 instead of 3.x. In that case you either connect python3 to the python command to solve that permanently or you will instead have to type

$ python3 my_program.py

Navigating directories

If you want to run a program inside a specific folder, you will first have to navigate there by typing:

$ cd [path_to_folder]
$ cd ~/Desktop
$ cd ~/my_folder

The tide sign ~ (type alt + n) stands for the users home directory, where Desktop, Downloads, ... are located. If you typed in the path correctly, the next line should look like

my_folder$

Now you’re ready to run a program inside this folder, e.g.

my_folder$ python my_program.py

USBGlossaryPythonTensorflowTerminal