teachers, students, everyone
Tools | Blog | Account | Learn

Connecting to Pi

  1. To connect to the Raspberry Pi you need it's IP address.
    Hover over the wifi icon and the status and ip address will popup. Take note of the IP Address.
  2. Open up Terminal on your PC or MAC. and type in the following (replace the IP address with the IP of your Pi): ssh pi@
    Note: pi is the username for the raspberry pi
  3. you will be prompted to enter a password. If you didn't change the default, it should be "raspberry"
  4. Now let's look around. Look at all the files in the current directory by using "ls"
    let's make a directory called "MyPi" by using the "mkdir" keyword - mkdir MyPi
  5. Create a file called mifile and add text to it. "Hello, World"
    Here are some commands that might help you
    cd - change directory
    cat - prints contents of a file
    cp file1 file2 # copy file1 to file2
    cp file1 directory # copy file1 into directory
    pwd - Show current working directory
    cd ../ - this goes back one directory
    grep - Look for text in files. List out lines containing text (with filename if more than one file examined).
    grep "hi there" file1 file2 ... # look for 'hi there' in files
    pwd > directory_path It grabs the output from the command on the left and feeds it to the file on the right
    echo 'Hello, cruel world!' >> directory_path //add to end of file
    du # which is short for disk usage. It tells you how much memory each subdirectory or file contained inside your current directory is using,
    ls -l | grep "Aug" # does command on left of pipe and sends results to right side command to work on.
    nano #allows you to edit files. This is a lightweight text editor
    A; B Run A and then B, regardless of success of A
    A && B Run B if A succeeded
    A || B Run B if A failed
    A & Run A in background.
    passwd - change password
    sudo adduser bob - create a new user named bob
  6. http://www.circuitbasics.com/useful-raspberry-pi-commands/
  7. Use echo 'Hello, cruel world!' >> directory_path //add to end of file
    to add text to end of jpg image