pwd
ls
("list") it shows the contents of the current directorywhen you type mkdir
("make dir") it creates a new SUBDIRECTORY inside the current directory
mkdir code
cd
("change dir") moves you into a different directorycd code
would move you into a directory named code
cd
all on its own and press the return key. This will send you back to your home directory.pwd
("print working dir") -- shows the name of the current directoryls
("list") -- shows the contents of the current directorymkdir
("make dir") -- creates a new SUBDIRECTORY inside the current directorycd
("change dir") -- move into a different directorytouch whatever.txt
-- creates an empty file named whatever.txt
inside the current directorymkdir code
cd code
ls
(and note that it's empty)to RUN a program you type ruby
and then the name of the source file
The Recipe Metaphor
code
subdirectory using pwd
hello.rb
using touch hello.rb
hello.rb
in your favorite text editorInside this file, put the following source code:
puts "Hello, World!"
Save the file
Go back to the terminal
Run this file using ruby hello.rb
What happens? Is this what you expected?
/