Learning to Program in Python for Kids

of all ages and Linux on a Raspberry Pi by Philip M Russell

Intro to the Basic Linux Commands

Some simple commands

pwd  - prints where you are on the system - print working directory

cd - change directory

ls - list the fles (dir also works but its not linux)

cp - copy a file - cp file1 file2  copies file1 to file2 - We don't need extensions - this isn't windows

Now we have to learn how to use these.

Lesson

In this short tutorial we we try out a few commads in the command line and make and move a few files in a simple file structure.

Lets meet our Guide

Pi Lixux Character

If you are in the GUI find and click on Terminal - if your not in the GUI this won't matter because all you see is $ prompt or another prompt depending on which Linux you downloaded. Often the colours can be changed to make the screen more readable.

$

This is the dollar prompt - the computer is awaiting you doing something.

type in pwd then press return or enter. You will see this or something similar

$ /home/philip 

This is my home directory.

Lets make a new directory to play with

mkdir test      - Make a newdirectory called test

We will now change to this directory

cd test     - the space is important

Now check which directory you are in

pwd  - print working directory   - some Linux systems display this as the prompt  but the command works just as well.

Let us now now make a file to play with

touch myfile - this makes a file called myfile - there is nothing in it.

We can now see this file in its directory by typing

ls   - list the files

You will now see a list of your files Pi Lixux Character

a longer fuller listing is obtained by typing ls -l  - ensure you put a space in. Both examples are in the image below. My directories have something in them so you can see what happens - your directories are probably empty