Intro to Terminal



Intro to Terminal

1 0


intro-command-line


On Github gdiannarbor / intro-command-line

Intro to Terminal

Intro to Terminal

Working in the terminal can be really intimidating at first!

With practice, navigation and file manipulationis 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.

Intro to Terminal

Mac & Linux users: Open Terminal Applications > Utilities > Terminal

Windows users: Install & Open Git-Bash

We will not be using Windows "cmd" program,as it uses a different syntax than *NIX systems.

Intro to Terminal Prompt

The line that appears in the terminal when you open it is calledthe 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.

Terminal Cheatsheet

. 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 -la "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 rm [filename] "remove" (delete) the file called [filename] rm -rf [directoryname] "remove recursively with force" the directory called [directoryname]With great power comes great responsibility. Be very careful with this one. clear OR cmd+k clear the terminal screen help lists all possible commands man [command] displays the manual for [command]

Terminal Activities

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 terminal_adventures
mkdir terminal_adventures

# navigate into the new terminal_adventures directory
cd terminal_adventures

# create a new file in the current (terminal_adventures) directory
touch hello.txt

# list the contents of the current (terminal_adventures) directory
ls

Terminal Activities

Not sure what a command does? Or how it works? Use manTry using man with a few commands. Type the letter q to exit man.

man ls

Output:

Let's Develop It!

Working in the terminal, create a directory called gdi_git in the location of your choosing.Desktop? Documents? Somewhere you'll be able to find it again!

Inside the gdi_git directory, create a file called setup.txt.

You're all set up!

Questions?

Message us in the #0415-git Slack channel.Get your Slack invite here: https://gdiaa-slack.herokuapp.com/

Homework

Practice: spend at least a few minutes practicing navigating and creating/removing documents and directories with the command line.

Intro to Terminal

Intro to Terminal ~ GDI Ann Arbor ~