Computer Use

Contains how-to guides for the command line, operating systems, filesystems, software installation and handling media formats.

Installing and Launching the Command Line on Your Computer

The command line -- sometimes also called the terminal or the shell -- is a way of navigating and using your computer that is similar to using the file browser (on mac: Finder, on Windows: File Explorer). It can be used to find, open and move files, run code, use version control software such as git, and install software.

The command line can be counter intuitive to use for the first time, and like many computer programming tools requires practice to be able to use fluently. It's also extremely useful, and presumed knowledge in software engineering jobs. The benefits of using the command line are many -- and you don't need to use it for everything to get good results.

Installing a Command Line

An important way to think about the command line is one way among many to navigate the computer. There are several different 'command lines' that you can have access to. For this guide, we will use Terminal for Mac users, and Git Bash for Windows users, which will allow us to use the same commands.

On a Mac

The most commonly used command line on Mac is called Terminal. This comes installed by default on all macs, so you don't need to do anything. Scroll down for the launching instructions.

On Windows

In this guide, we will give instructions for using a "Unix type" command line. This does not come installed by default on Windows systems, which instead have something called 'Command Prompt' -- commands used on Unix type command lines are different.

The command line we will install instead is called Git Bash.

Step 1: Download You need to download Git Bash by clicking the 'Windows' link on this website. This will take you to a page with multiple different options. To get the most recent installer, click the link circled in red below.

Step 2: Launch Installer Once your installer has downloaded, navigate to the 'Downloads' folder on your computer and double click the file called something like 'Git-2.49.0-64-bit.exe' (the numbers in yours might be different). This will open the installer.

Step 3: Click through Installer Click through each step, selecting the default options. When you reach the 'Select Components' option, make sure the following tools are selected.

Select Nano as the default editor. This is easier to use than Vim, which is set as the default. You can also select any other listed editor that you are comfortable with.

Leave everything else as default, and click through to the end!

Launching the Command Line

On a Mac

Step 1: To open the Terminal, press ⌘ and Space to open the 'Spotlight Search'. Type 'Terminal', and you should see a black icon with a white triangle.

Step 2: Press enter, and a window should open. Depending on your computer's settings, it will have either a white or a black background. It should say 'zsh' at the top, and have a ~ symbol, possibly combined with your username.

Step 3: Sometimes, the first time you open a Terminal on a Mac, it might come up with a message saying “The default interactive shell is now zsh.” -- this is fine and you don't need to do anything! This is just giving you some information about the software that runs the command line.

On Windows

Step 1: To open Git Bash, navigate to the Start menu and start to type 'Git Bash'. Click on the application to open a window.

Step 2: You should see a window open, probably green, pink, yellow and white text on a black background. This will have your computer's name followed by a ~ symbol, and a $ with a flashing cursor next to it.

Congratulations, you've got a command line!

Workshop: File Systems and the Command Line

In this workshop we will get to know our computer better, learn about the idea of the filesystem, and explore it using a tool called the Command Line. We will learn some useful commands, and also learn more about how computers work, which will prepare us for writing code. If you need a reference at any point in the workshop, there is a list of commands included at the end of the page.

To get set up for this workshop, you need to have a suitable Command Line that you can launch installed on your computer. Please follow the instructions in this guide to make sure you have this, especially if you use Windows.

Intro: What are Computers?

Computers are Everywhere!

We have access to a lot of different devices that run code and software. These include systems like a laptop or a desktop computer, but also phones, watches, cars, tablets and e-Readers. Some of these devices, like desktop computers, give us some control over how they operate, and allow us to look inside them. Others, like phones, hide a lot of their inner systems away and make it hard for the average user to look inside.

Your Computer is a Load of Files

Lots of things have changed about computers in the past few decades -- they're a lot faster, there is a lot of emphasis on graphics, and it's much easier to find things than it used to be -- but the way that computers work has not fundamentally changed. All computers use something called an 'operating system' to work: you might use an operating system like Mac or Windows, or maybe one of a family of systems called Linux.

These different operating systems will work on slightly different principles, but at the core there are lots of similarities.

What is a file? It's a way that your computer stores a load of information, grouped together in one place, and represented by a specific format. We will

Demo: Secret Files

We are going to look inside an application and see all the files that make it up. You are welcome to follow along -- but it's also fine to watch this part! In this demo, I will also show you how to make your file browser a better tool for seeing inside your computer. When I do these steps, have a go at doing them with me.

Activity: Command Line House Tour

In this part of the workshop, we will make an explorable game using the command line. By the end of this activity, you should be more familiar with your file browser

We will use generic names to refer to specific things. So:

Intro: the filesystem

The filesystem is the name given to the system on your computer that manages and looks after files. It's the part of your computer that you navigate in order to open, read and edit different files.

Part 1: Navigating using the File Browser

Step 1: Open
Open the file browser. on your computer. On a Mac, this is called Finder. On Windows, this is called 'File Explorer'

Step 2: Desktop
Click to navigate to the 'Desktop' in the file browser. The desktop is just another folder, but on both Mac and Windows, it behaves like a special folder where you can see the files on your main computer screen.

Step 3: Class Folder
We are going to make a folder to store all the files made in this workshop. In your Desktop, create a new folder called 'computer-friend'. Make sure you use a dash rather than a space! We'll find out later why this is important.

Part 2: Exploring the House

I've made a small game to demonstrate the activity. We're going to download and extract it, put it in our new folder, and then look inside.

Step 1: Download
Download the 'house-tour' folder by clicking on this link.

Step 2: Extract
This is a 'zipped' folder -- it is a way of compressing a bunch of files into a smaller, single object so it can be sent around. We need to extract the files

Step 3: Move
We are going to move the unzipped folder into the 'computer-friend' folder we made in part one. Open a second file browser window, then drag and drop the 'house' folder inside of the 'computer friend' folder. You should end up with a folder layout that looks like this (look at the path bar to see the structure):

Part 3: Navigating using the Command Line

Now we are familiar with our house, we are going to explore it again, but this time using the command line.

Step 1: Launch the Command Line
Open the command line on your computer. Use this guide as a reference if you're not sure how! If you use windows and you haven't done this already, make sure you follow the instructions in that guide to install and open Git Bash.

Step 2: Navigate to the House
When we downloaded the 'house' folder, we moved it to a folder on our Desktop that we navigated to by clicking. We are going to do the same thing now, but using text commands. When you click on your terminal window, you should see a shaded block indicating your cursor. If you start typing, text will appear there.

We are going to use the cd command to navigate. Type out the follwing line, and press enter. To make sure you learn it, type it manually rather than copy pasting!

Challenge: Find the secret room
There's a hidden room in the house! You can modify the ls command with ls -a to show hidden folders and files. Try to locate this secret room and solve the puzzle inside!

Part 4: Making folders and files using the Command Line

We are going to make an extension for the house! As an example, we are going to make an extra room called cellar, and then fill it with objects that people in the house have thrown away.

Step 1: Corridor
Navigate to the 'corridor' folder in the house, using the cd command. A simple way to do this is to type cd .. until you end up back at the folder house, and then use cd door/corridor to go back to the corridor. It's important we move to the correct location before we create our file there

Step 2: Making a Folder
We've already made a folder in our file browser. To do the same thing in our command line, we're going to a command called mkdir, which stands for 'Make Directory'. To use the command, type mkdir, then a space, then the name of the folder you want to make (without a space in it). Then press enter.

When you type in ls, you should see the new file.

Step 3: Making a File
To make some objects in the cellar, we need to go inside it. Use the cd command to navigate.

The command we use to make a new file is touch. This is a weird name, and refers to an old way of talking about how opening a file could affect computer memory. To create a text file, we will use it like this:

We can now open this file in a text editor.

Challenge: Add another room
Now you have a sense for how these commands work, try adding another room somewhere in the house, using the mkdir command! Try adding some objects using the touch command.

Extra tips
touch and mkdir can be used to make multiple things at once. So, if you type mkdir house garden street, it will make three folders in your current location: one called house, one called garden, one called street

Part 5: Make your Own Adventure

Step 1: space
Think of a space that you'd like to give someone a tour of. It could be real or imaginary, manmade or natural -- maybe it's your house, or a forest near where you grew up, or the top of a skyscraper

Step 2: make it a home
Navigate back to your 'computer-friend' folder in the command line, using the cd .. command. Now, use mkdir your-space-name (replace 'your-space-name' with the name of your space) to make it a folder. You can use the ls command, or the file browser, to check that it was made in the place you thought!

Step 3: add rooms and objects!
Navigate inside it using cd your-space-name (again replacing 'your-space-name' with whatever you called the folder.

Step 4: add rooms and objects!
Still using the command line, and the commands we learned above, try fleshing out your space by adding rooms, folders and objects. Consider using a piece of paper to make a map to help you plan! If you get lost, there's a cheatsheet of commands at the bottom of this page.

Try and make a space that contains at least 4 rooms, and 6 objects.

Part 6: Text Adventure Swap

Now, try and share your adventure with someone else in the class (if you're doing this at home alone then you can always send it to Agnes).

Step 1: Compress the Files
Using your file browser, navigate to the Desktop, where you should be able to see the 'computer-friend' folder.

Step 2: Share the Files
Using Slack or Email, share the files, either with the class or with the person next to you!

Tools and Further Reading

File Browser Commands

Show hidden files:

Show path bar:

List of Command Line Commands

In this session, we are going to use the following commands:

command name meaning
pwd "print working directory" print out a path to my current location
ls "list" list the files and folders in the current location
cd "change directory" move to a different folder
cd .. "change directory" move UP one folder
cd ~ "change directory" navigate to the Home directory
touch file.txt "touch" make a new, empty file called file.txt
cat file.txt "concatenate" print out the contents of a file called file.txt
mkdir my-folder "make directory" make a new folder called 'my-folder'

Neat tricks:

Watch out for:

Further Reading

If you would like to explore more of the ideas covered in the workshop, take a look at one or all of the following readings: