`
Girl Develop It is dedicated to providing a harassment free learning experience for everyone.
For more information, see our Code of Conduct.
We'll follow Zed Shaw's install instructions from "Learn Ruby the Hard Way" to get set up.
Working in the terminal can be really intimidating at first!
With practice, navigation and file manipulation
is significantly faster in the terminal than in the GUI.
Professional software developers use the terminal all the time,
and this class will require some use of it.
Mac & Linux users: Open Terminal
Windows users: Open PowerShell
Aw crap nothing is working users: Let us know.
Syntax may be different on Windows vs. Mac.
Let us know if you hit any trouble.
The line that appears in the terminal when you open it is called
the prompt.
It usually contains information about the user and current directory.
It can be customized.
Terminal instructions often start a line with a $.
This just represents the last character in the prompt, you don't have to type it.
. |
the current directory- ex: touch ./wow.txt |
.. |
the parent of current directory - ex: cd ../RubyParty |
~ |
the root directory- ex: cd ~/Pictures |
cd [location] |
"change directory" to [location] |
pwd |
"present working directory" - where am I? |
ls -al |
"list all" of the contents of current directory, including invisible ones |
touch [filename.extension] |
create a file called [filename.extension] in the current directory |
mkdir [directoryname] |
create a directory called [directoryname] in the current directory With great power comes great responsibility. Be very careful with this one. |
rm [filename] |
"remove" (delete) the file called [filename] |
clear OR cmd+k |
clear the terminal screen |
help |
lists all possible commands |
man [command] |
displays the manual for [command] |
Try out the following commands!
Things that start with #
are comments - you don't need to type those out.
# navigate to your desktop
cd ~/Desktop #Linux, Mac
cd desktop #Windows
# make a directory called ruby_adventures
mkdir ruby_adventures
# navigate into the new ruby_adventures directory
cd ruby_adventures
# create a new file in the current (ruby_adventures) directory
touch setup.rb
# list the contents of the current (ruby_adventures) directory
ls
Not sure what a command does? Or how it works? Use man
Try using man
with a few commands. Type the letter q
to exit man
.
man ls
Output:
Working in the terminal, create a directory called gdi_ruby
in the location of your choosing.
Desktop? Documents? Somewhere you'll be able to find it again!
Inside the gdi_ruby
directory, create a file called do_i_ruby.rb
.
Keep learning with these activities in IRB: Ruby in 20 minutes
Did your system get weird? You can use this Terminal, Power Shell alternative: repl.it