|
@@ -2,17 +2,17 @@
|
2
|
2
|
|
3
|
3
|
## Objectives
|
4
|
4
|
|
5
|
|
-1. In this lab students will learn to navigate their file system using only the terminal
|
|
5
|
+1. GIt git git git In this lab students will learn to navigate their file system using only the terminal
|
6
|
6
|
2. Students will practice using the following commands to traverse directories and investigate their contents: `pwd`, `ls`, `cd`, `cat`, `less`, `grep`
|
7
|
7
|
|
8
|
8
|
|
9
|
9
|
## Overview
|
10
|
10
|
|
11
|
|
-The console (also referred to as the command line, terminal, or shell) is an essential tool for programmers to be familiar with. The command line shell we will be using is called Bash. This lab will focus on the basics for navigating and investigating the file system through the command line. In this lab we will only be using the command line in interactive mode (more on that in the Bash labs). Here are the commands we will focus on:
|
|
11
|
+The console (also referred to as the command line, terminal, or shell) is an essential tool for programmers to be familiar with. git git The command line shell we will be using is called Bash. This lab will focus on the basics for navigating and investigating the file system through the command line. In this lab we will only be using the command line in interactive mode (more on that in the Bash labs). Here are the commands we will focus on:
|
12
|
12
|
|
13
|
13
|
- `pwd` - "Print Working Directory" prints out your current location (known as your current working directory or 'cwd')
|
14
|
14
|
- `ls` - lists contents of the cwd
|
15
|
|
-- `cd` - change directory. This is how you move around the file system. You can specify the destination as an absolute or relative path.
|
|
15
|
+- `cd` - change directory. This is how you move around the file system. You git git can specify the destination as an absolute or relative path.
|
16
|
16
|
- `echo` - prints text to the terminal
|
17
|
17
|
- `cat` - concatenates zero or more files. Often used to print the contents of a file to the terminal. [Often misused](https://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat)
|
18
|
18
|
- `less`/`more` - Display contents of a file one page at a time ...just remember that less is more ([more or less](http://unix.stackexchange.com/questions/81129/what-are-the-differences-between-most-more-and-less)) and you'll be fine.
|
|
@@ -94,7 +94,7 @@ To create a file using touch, simply type the command followed by the name of th
|
94
|
94
|
|
95
|
95
|
There are many text editors out there. We will be using an editor called VIM (short for VI iMproved -- it is a clone of the editor VI with some improvements). Other options that you can explore on your own include emacs and nano (a clone of a program called pico). Here are the VIM commands we'll use along with a few other useful basics (there are many, many, many many more):
|
96
|
96
|
|
97
|
|
-- `:w` - Write; writes the current contents of the buffer (editor) to a file.
|
|
97
|
+- `:w` - Write; writes the current contents of the buffer (editor) to a file.
|
98
|
98
|
- `:q` - Quit; Quits VIM. Complains if you have unsaved changes (use `:w` first, or `:q!` to force quit and abandon your changes)
|
99
|
99
|
- `:set number`/`:set nonumber` - Enables/disables line numbers.
|
100
|
100
|
- `a` - Switch to insert mode after the current character. `A` goes to the end of the line instead.
|
|
@@ -175,7 +175,7 @@ Now let's practice one more backgrounding technique with a different command.
|
175
|
175
|
- Now you're stuck without your prompt; but we can fix that! Press `Ctrl`+`Z` to suspend (not kill) that program.
|
176
|
176
|
- Now you've got your terminal back, but if you type `jobs` you'll see that python is currently stopped. You can bring it back with `fg`, but that will block your prompt again; instead, use `bg` to resume it in the background.
|
177
|
177
|
- Now that you've resumed python in the background, you can see it listed as running in `jobs`. Bring it back to the foreground with `fg` and then kill it with `Ctrl`+`C`
|
178
|
|
-
|
|
178
|
+
|
179
|
179
|
|
180
|
180
|
## Other Resources
|
181
|
181
|
|
|
@@ -192,4 +192,3 @@ The next lab is [here](https://github.com/Zipcoder/ZCW-Microlabs-Git).
|
192
|
192
|
2. "more or less" http://unix.stackexchange.com/questions/81129/what-are-the-differences-between-most-more-and-less
|
193
|
193
|
3. "Command Line Crash Course" http://learnpythonthehardway.org/book/appendixa.html
|
194
|
194
|
4. "VIM 101" https://www.linux.com/learn/vim-101-beginners-guide-vim
|
195
|
|
-
|