Other Pages

Expand All

The Command Line

The Command Line

Opening the Terminal


The Current Directory

Home Directory

Listing Directory Contents

Making a directory

Changing directories

Basic Command Line Glossary

LAB: make a subdirectory and then enter it

  1. open Terminal
  2. make a new subdirectory using mkdir code
  3. change into that directory using cd code
  4. list its contents using ls (and note that it's empty)


Text Editor

Source File

LAB: Hello, World

  1. Make sure you are in your code subdirectory using pwd
  2. Create a file named hello.rb using touch hello.rb
  3. Open hello.rb in your favorite text editor
  4. Inside this file, put the following source code:

    puts "Hello, World!"
  5. Save the file

  6. Go back to the terminal

  7. Run this file using ruby hello.rb

What happens? Is this what you expected?

Back to Learn To Code

If you find something that could be improved, please make a pull request or drop us a note via GitHub Issues (no technical knowledge required).

Source: https://github.com/RailsBridge-CapeTown