Mission 1.1 - The Terminal
What is it?
The terminal is the graphical user interface (GUI) that interacts with the shell. It is essentially the front end (what we interact with) of the shell. It reads what we input via the keyboard and it deals with the computer.
The shell is the actual software that takes the commands (what you type) from your keyboard and passes it to the Operating System (OS). If we had to deal directly with the shell (which deals directly with the computer), getting things done would take a very long time because the computer only understands binary, 1’s and 0’s.
Here’s an analogy to help you understand: Think of the terminal and shell together as a radio set. The shell is everything that goes on in the machine when we press buttons, similar to providing input to the shell. The terminal is what we hear from the radio when the shell has interpreted our input.
Why use it?
If you know the right commands, you can do certain things a lot faster. Some things are easier to do with a GUI than through the terminal. However, if you know the proper command, it can be more efficient to use the terminal.
​
Basic commands
There are hundreds and hundreds of commands, but we will focus on the few that you will need to complete Mission 1.
You must write commands exactly as they appear
-
ls-the list command. This will list all files and subdirectories within a directory. A directory is essentially a folder within your computer. A directory can contain more files and subfolders.
-
cd [directory name]-will change the directory you are in
-
Think of it as moving from one room to another
-
pwd - the directory you are currently working in is called the working directory. The command pwd allows to you get the actual path name of the working directory.
-
Think of it as being told the exact location of where you are:
-
For example: Grady High School/First floor/ Rm 301
-
cp - copy files and directories
-
mv - move or rename files and directories
-
rm file/directory name - remove/delete files and directories. Beware! You can’t undo this deletion.
-
mkdir directoryName- creates new directories
-
touch - creates new files
The following links provide more information on the terminal and other commands you can use:
a. https://maker.pro/linux/tutorial/basic-linux-commands-for-beginners
b. https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/
Mission 1
-
Launch the terminal
-
On Mac, go to the LaunchPad and search terminal.app
-
On Windows, go to the shell and run python commands to access and make files
-
-
Navigate to the directory/folder you would like to save the project in (hint: ls and cd will help with this)
-
Create a new folder and name it “CodingDetective” (hint: mkdir)
-
Create a file named “Lesson1.py” (hint: touch)
-
Download the following file GreetingsDetective.py, save in the directory
-
To run the file, enter ‘python3 filename’ into terminal