Basic Linux Operations

 Change{RPi ip address} to the actual ip address of your RPi 

 

Remote login to RPI

From command line console (Cygwin/Iterm) following command says, ssh user pi onto RPi use RPi’s ip address:

ssh pi@{RPi ip address}

 

If you use Putty, put you RPi ip address in ‘Host Name (or IP address). Also check other settings is as shown below. Then click ‘Open’.

Type in password when prompts (default one is pi if you have not changed it)

Now we are connected to Our RPi. Hooray!

You ask: But where are we? Where about we landed? Like an astronaut just landed on the moon, we need to find our way around. Here are some basic commands to help you navigate around RPi.

Note: dollar sign $ is command prompt, the operation instruction is what you type after the $ sign.

 

Find out where are we (Current working directory)

note: pwd short for Present Working Directory. It show us indeed we are in the home directory of user pi.

 

$pwd

List Files and Directories

note: ls short for List Files and subdirectories in current place. As you can see, we have a few folders there already

 

$ ls
Desktop  Documents  Downloads  Music  Pictures Public python_games  Templates  venvs  Videos

 

Change Directory to …

note: cd short for Change Directory. Now we are in python_games directory.

 

$ cd python_games/

Whatever directory we are, we can ‘zoom’ back to the home directory by the shortcut ‘~’

$ cd ~  [return]
$ pwd
/home/pi

Edit a File

 

nano {file name}  [return]

Copy a File

$ cp myfile.py {new file name}[return]

 

Send a file from your working PC (Mac, Windows)

$scp myfile.py pi@{RPi ip address}:/home/pi/scripts/