diff --git a/novice/git/01-backup.md b/novice/git/01-backup.md index bb82d5ee7..c78b90f32 100644 --- a/novice/git/01-backup.md +++ b/novice/git/01-backup.md @@ -870,6 +870,12 @@ nothing to commit, working directory clean +#### Concept Map + +Git Concept Map + +#### Challenges +
Create a new Git repository on your computer called `bio`. Write a three-line biography for yourself in a file called `me.txt`, diff --git a/novice/git/02-collab.md b/novice/git/02-collab.md index cc06c6a12..2620a94b8 100644 --- a/novice/git/02-collab.md +++ b/novice/git/02-collab.md @@ -264,6 +264,12 @@ to share work between different people and machines.
+#### Concept Map + +Collaboration Concept Map + +#### Challenges +
Create a repository on GitHub, clone it, diff --git a/novice/git/03-conflict.md b/novice/git/03-conflict.md index 319f573fd..3950a2523 100644 --- a/novice/git/03-conflict.md +++ b/novice/git/03-conflict.md @@ -315,6 +315,12 @@ or find a way to divide the work up differently.
+#### Concept Map + +Conflict Concept Map + +#### Challenges +
Clone the repository created by your instructor. Add a new file to it, diff --git a/novice/git/img/01-backup.gv b/novice/git/img/01-backup.gv new file mode 100644 index 000000000..a49b24942 --- /dev/null +++ b/novice/git/img/01-backup.gv @@ -0,0 +1,13 @@ +graph G { + repository [style=bold]; + commit [style=bold]; + git -- repository; + repository -- commit; + commit -- "commit message"; + commit -- identifier; + repository -- "staging area" -- "working files"; + repository -- log -- commit; + git -- "git diff"; + git -- "git checkout"; + repository -- ".gitignore"; +} \ No newline at end of file diff --git a/novice/git/img/01-backup.gv.svg b/novice/git/img/01-backup.gv.svg new file mode 100644 index 000000000..2739d5239 --- /dev/null +++ b/novice/git/img/01-backup.gv.svg @@ -0,0 +1,112 @@ + + + + + + +G + + +repository + +repository + + +commit + +commit + + +repository--commit + + + +staging area + +staging area + + +repository--staging area + + + +log + +log + + +repository--log + + + +.gitignore + +.gitignore + + +repository--.gitignore + + + +commit message + +commit message + + +commit--commit message + + + +identifier + +identifier + + +commit--identifier + + + +git + +git + + +git--repository + + + +git diff + +git diff + + +git--git diff + + + +git checkout + +git checkout + + +git--git checkout + + + +working files + +working files + + +staging area--working files + + + +log--commit + + + + diff --git a/novice/git/img/02-collab.gv b/novice/git/img/02-collab.gv new file mode 100644 index 000000000..74b2fa1d2 --- /dev/null +++ b/novice/git/img/02-collab.gv @@ -0,0 +1,9 @@ +digraph G { + local [shape=rect, label="local repository"]; + otherlocal [shape=rect, label="collaborator's local repository"]; + remote [shape=rect, label="remote repository"]; + remote -> local [label="clone"]; + remote -> local [label="pull"]; + local -> remote [label="push"]; + remote -> otherlocal [label="clone"]; +} \ No newline at end of file diff --git a/novice/git/img/02-collab.gv.svg b/novice/git/img/02-collab.gv.svg new file mode 100644 index 000000000..58c6b0393 --- /dev/null +++ b/novice/git/img/02-collab.gv.svg @@ -0,0 +1,52 @@ + + + + + + +G + + +local + +local repository + + +remote + +remote repository + + +local->remote + + +push + + +otherlocal + +collaborator's local repository + + +remote->local + + +clone + + +remote->local + + +pull + + +remote->otherlocal + + +clone + + + diff --git a/novice/git/img/03-conflict.gv b/novice/git/img/03-conflict.gv new file mode 100644 index 000000000..74b2fa1d2 --- /dev/null +++ b/novice/git/img/03-conflict.gv @@ -0,0 +1,9 @@ +digraph G { + local [shape=rect, label="local repository"]; + otherlocal [shape=rect, label="collaborator's local repository"]; + remote [shape=rect, label="remote repository"]; + remote -> local [label="clone"]; + remote -> local [label="pull"]; + local -> remote [label="push"]; + remote -> otherlocal [label="clone"]; +} \ No newline at end of file diff --git a/novice/git/img/03-conflict.gv.svg b/novice/git/img/03-conflict.gv.svg new file mode 100644 index 000000000..58c6b0393 --- /dev/null +++ b/novice/git/img/03-conflict.gv.svg @@ -0,0 +1,52 @@ + + + + + + +G + + +local + +local repository + + +remote + +remote repository + + +local->remote + + +push + + +otherlocal + +collaborator's local repository + + +remote->local + + +clone + + +remote->local + + +pull + + +remote->otherlocal + + +clone + + + diff --git a/novice/shell/00-intro.md b/novice/shell/00-intro.md index 77d838ce1..9cbbc327d 100644 --- a/novice/shell/00-intro.md +++ b/novice/shell/00-intro.md @@ -135,3 +135,7 @@ being able to drive them is becoming a necessary skill. and how cryptic its commands and operation can be.
+ +#### Concept Map + +Intro Concept Map diff --git a/novice/shell/01-filedir.md b/novice/shell/01-filedir.md index a2957dd9a..c10bb6fbc 100644 --- a/novice/shell/01-filedir.md +++ b/novice/shell/01-filedir.md @@ -230,6 +230,10 @@ rather than from the root of the file system. > most people use them interchangeably or inconsistently, > so we will too. +#### Concept Map + +Command Concept Map + If we run `ls -F /data` (*with* a leading slash) we get a different answer, because `/data` is an [absolute path](../../gloss.html#absolute-path): @@ -469,6 +473,12 @@ and we will see it in many other tools as we go on. +#### Concept Map + +Path Concept Map + +#### Challenges + Filesystem for Challenge Questions
diff --git a/novice/shell/02-create.md b/novice/shell/02-create.md index fd56798ea..e96e129bb 100644 --- a/novice/shell/02-create.md +++ b/novice/shell/02-create.md @@ -366,6 +366,12 @@ thesis/quotations.txt
+#### Concept Map + +File Operation Concept Map + +#### Challenges +
What is the output of the closing `ls` command in the sequence shown below? diff --git a/novice/shell/03-pipefilter.md b/novice/shell/03-pipefilter.md index 64fca0402..c6f8edcbc 100644 --- a/novice/shell/03-pipefilter.md +++ b/novice/shell/03-pipefilter.md @@ -398,6 +398,16 @@ so this matches all the valid data files she has.
+#### Wildcards Concept Map + +Wildcards Concept Map + +#### Pipes and Filters Concept Map + +Pipes and Filters Concept Map + +#### Challenges +
If we run `sort` on this file: diff --git a/novice/shell/04-loop.md b/novice/shell/04-loop.md index 939ad89b6..fd898acbe 100644 --- a/novice/shell/04-loop.md +++ b/novice/shell/04-loop.md @@ -411,6 +411,12 @@ so she decides to get some coffee and catch up on her reading.
+#### Concept Map + +Loop Concept Map + +#### Challenges +
Suppose that `ls` initially displays: diff --git a/novice/shell/05-script.md b/novice/shell/05-script.md index 9f4759b4d..d1ec3564c 100644 --- a/novice/shell/05-script.md +++ b/novice/shell/05-script.md @@ -294,6 +294,9 @@ we have a completely accurate record of how we created that figure. > history | tail -5 > history | tail -5 | colrm 1 7 > ~~~ +> +> The `colrm` may not be installed on every computer, and specifically on Windows computers. +> `cut` and `awk` are two other tools that can achieve a similar purpose. In practice, most people develop shell scripts by running commands at the shell prompt a few times to make sure they're doing the right thing, @@ -382,6 +385,12 @@ Of course, this introduces another tradeoff between flexibility and complexity.
+#### Concept Map + +Script Concept Map + +#### Challenges +
Leah has several hundred data files, each of which is formatted like this: diff --git a/novice/shell/06-find.md b/novice/shell/06-find.md index fda7007ac..e029498b8 100644 --- a/novice/shell/06-find.md +++ b/novice/shell/06-find.md @@ -444,6 +444,12 @@ about them."
+#### Concept Map + +grep and find Concept Map + +#### Challenges +
Write a short explanatory comment for the following shell script: diff --git a/novice/shell/img/00-intro.gv b/novice/shell/img/00-intro.gv new file mode 100644 index 000000000..c8299315c --- /dev/null +++ b/novice/shell/img/00-intro.gv @@ -0,0 +1,9 @@ +digraph g{ + shell [label="shell (also command line)"]; + CLI [label="CLI (Command Line Interface)"]; + GUI [label="GUI (Graphical User Interface)"]; + shell -> CLI [label="is a"]; + CLI -> shell [label="runs from"]; + program -> GUI [label="either"]; + program -> CLI [label="either"]; +} \ No newline at end of file diff --git a/novice/shell/img/00-intro.gv.svg b/novice/shell/img/00-intro.gv.svg new file mode 100644 index 000000000..76a15fb20 --- /dev/null +++ b/novice/shell/img/00-intro.gv.svg @@ -0,0 +1,57 @@ + + + + + + +g + + +shell + +shell (also command line) + + +CLI + +CLI (Command Line Interface) + + +shell->CLI + + +is a + + +CLI->shell + + +runs from + + +GUI + +GUI (Graphical User Interface) + + +program + +program + + +program->CLI + + +either + + +program->GUI + + +either + + + diff --git a/novice/shell/img/01-filedir-command.gv b/novice/shell/img/01-filedir-command.gv new file mode 100644 index 000000000..565c92510 --- /dev/null +++ b/novice/shell/img/01-filedir-command.gv @@ -0,0 +1,13 @@ +graph g{ + label="$ ls -F /etc"; + fontsize=20; + shell [label="shell: $"]; + program [label="program: ls"]; + paths [label="paths: /etc"]; + flags [label="flags: -F"]; + shell -- command; + command -- program; + command -- arguments; + arguments -- paths; + arguments -- flags; +} \ No newline at end of file diff --git a/novice/shell/img/01-filedir-command.gv.svg b/novice/shell/img/01-filedir-command.gv.svg new file mode 100644 index 000000000..9ab8e147d --- /dev/null +++ b/novice/shell/img/01-filedir-command.gv.svg @@ -0,0 +1,64 @@ + + + + + + +g + +$ ls -F /etc + +shell + +shell: $ + + +command + +command + + +shell--command + + + +program + +program: ls + + +paths + +paths: /etc + + +flags + +flags: -F + + +command--program + + + +arguments + +arguments + + +command--arguments + + + +arguments--paths + + + +arguments--flags + + + + diff --git a/novice/shell/img/01-filedir-path.gv b/novice/shell/img/01-filedir-path.gv new file mode 100644 index 000000000..f64cddaf4 --- /dev/null +++ b/novice/shell/img/01-filedir-path.gv @@ -0,0 +1,12 @@ +graph g{ + filesystem -- directory; + filesystem -- file; + directory -- path; + file -- path; + directory -- root; + path -- absolute; + path -- relative; + absolute -- root; + relative -- "working directory"; + directory -- "working directory"; +} \ No newline at end of file diff --git a/novice/shell/img/01-filedir-path.gv.svg b/novice/shell/img/01-filedir-path.gv.svg new file mode 100644 index 000000000..cd94190a6 --- /dev/null +++ b/novice/shell/img/01-filedir-path.gv.svg @@ -0,0 +1,93 @@ + + + + + + +g + + +filesystem + +filesystem + + +directory + +directory + + +filesystem--directory + + + +file + +file + + +filesystem--file + + + +path + +path + + +directory--path + + + +root + +root + + +directory--root + + + +working directory + +working directory + + +directory--working directory + + + +file--path + + + +absolute + +absolute + + +path--absolute + + + +relative + +relative + + +path--relative + + + +absolute--root + + + +relative--working directory + + + + diff --git a/novice/shell/img/02-create.gv b/novice/shell/img/02-create.gv new file mode 100644 index 000000000..e3947cfd1 --- /dev/null +++ b/novice/shell/img/02-create.gv @@ -0,0 +1,35 @@ +graph G { + subgraph cluster_0 { + label = "create"; + color=green; + nano; + mkdir; + cp; + } + subgraph cluster_1 { + label = "delete"; + color=red; + dangerous [style=filled fillcolor="#ff8888"]; + rm; + "rm -r"; + rmdir; + rm -- dangerous; + "rm -r" -- dangerous; + } + subgraph cluster_3 { + label = "navigate"; + color=blue; + cd; + } + cp_params [style=filled fillcolor="#88ff88" label="file file | file dir | file file [..] dir"]; + file [style=filled fillcolor="#88ff88"]; + directory [style=filled fillcolor="#88ff88"]; + cd -- directory; + mkdir -- directory; + nano [label="text editor (e.g. nano)"]; + nano -- file; + cp -- cp_params; + rm -- file; + rmdir -- directory; + "rm -r" -- directory; +} \ No newline at end of file diff --git a/novice/shell/img/02-create.gv.svg b/novice/shell/img/02-create.gv.svg new file mode 100644 index 000000000..1c39a8276 --- /dev/null +++ b/novice/shell/img/02-create.gv.svg @@ -0,0 +1,116 @@ + + + + + + +G + +cluster_0 + +create + +cluster_1 + +delete + +cluster_3 + +navigate + + +nano + +text editor (e.g. nano) + + +file + +file + + +nano--file + + + +mkdir + +mkdir + + +directory + +directory + + +mkdir--directory + + + +cp + +cp + + +cp_params + +file file | file dir | file file [..] dir + + +cp--cp_params + + + +dangerous + +dangerous + + +rm + +rm + + +rm--dangerous + + + +rm--file + + + +rm -r + +rm -r + + +rm -r--dangerous + + + +rm -r--directory + + + +rmdir + +rmdir + + +rmdir--directory + + + +cd + +cd + + +cd--directory + + + + diff --git a/novice/shell/img/03-pipefilter-wildcards.gv b/novice/shell/img/03-pipefilter-wildcards.gv new file mode 100644 index 000000000..b0941f69c --- /dev/null +++ b/novice/shell/img/03-pipefilter-wildcards.gv @@ -0,0 +1,30 @@ +graph G { + label="path wildcards"; + subgraph cluster_0 { + label="primitives"; + "a"; + "*"; + "?"; + "[ab]"; + } + subgraph cluster_1 { + label="examples"; + "???.txt"; + "*.txt"; + "ar[cr]*"; + + "arc.txt" [shape=square]; + "are.txt" [shape=square]; + "arrow.txt" [shape=square]; + "arc.png" [shape=square]; + + "???.txt" -- "arc.txt"; + "???.txt" -- "are.txt"; + "*.txt" -- "arc.txt"; + "*.txt" -- "are.txt"; + "*.txt" -- "arrow.txt"; + "ar[cr]*" -- "arc.txt"; + "ar[cr]*" -- "arrow.txt"; + "ar[cr]*" -- "arc.png"; + } +} \ No newline at end of file diff --git a/novice/shell/img/03-pipefilter-wildcards.gv.svg b/novice/shell/img/03-pipefilter-wildcards.gv.svg new file mode 100644 index 000000000..dcf929dde --- /dev/null +++ b/novice/shell/img/03-pipefilter-wildcards.gv.svg @@ -0,0 +1,109 @@ + + + + + + +G + +path wildcards +cluster_0 + +primitives + +cluster_1 + +examples + + +a + +a + + +* + +* + + +? + +? + + +[ab] + +[ab] + + +???.txt + +???.txt + + +arc.txt + +arc.txt + + +???.txt--arc.txt + + + +are.txt + +are.txt + + +???.txt--are.txt + + + +*.txt + +*.txt + + +*.txt--arc.txt + + + +*.txt--are.txt + + + +arrow.txt + +arrow.txt + + +*.txt--arrow.txt + + + +ar[cr]* + +ar[cr]* + + +ar[cr]*--arc.txt + + + +ar[cr]*--arrow.txt + + + +arc.png + +arc.png + + +ar[cr]*--arc.png + + + + diff --git a/novice/shell/img/03-pipefilter.gv b/novice/shell/img/03-pipefilter.gv new file mode 100644 index 000000000..e7aed72b1 --- /dev/null +++ b/novice/shell/img/03-pipefilter.gv @@ -0,0 +1,22 @@ +graph G { + label = "small pieces, loosely joined:\n head -5 < animals.txt | tail -3 | sort -r > final.txt"; + subgraph cluster_0 { + label = "filters"; + color=blue; + wc; + sort; + head; + } + subgraph cluster_1 { + label = "redirection"; + color=green; + to [label="to > file"]; + from [label="from < file"]; + pipe [label="pipe | filter | filter"]; + } + stdin -- from; + stdout -- to; + stdin -- pipe -- stdout; + keyboard -- stdin [label="default"]; + stdout -- screen [label="default"]; +} \ No newline at end of file diff --git a/novice/shell/img/03-pipefilter.gv.svg b/novice/shell/img/03-pipefilter.gv.svg new file mode 100644 index 000000000..6b96238a3 --- /dev/null +++ b/novice/shell/img/03-pipefilter.gv.svg @@ -0,0 +1,99 @@ + + + + + + +G + +small pieces, loosely joined: + head -5 < animals.txt | tail -3 | sort -r > final.txt +cluster_0 + +filters + +cluster_1 + +redirection + + +wc + +wc + + +sort + +sort + + +head + +head + + +to + +to > file + + +from + +from < file + + +pipe + +pipe | filter | filter + + +stdout + +stdout + + +pipe--stdout + + + +stdin + +stdin + + +stdin--from + + + +stdin--pipe + + + +stdout--to + + + +screen + +screen + + +stdout--screen + +default + + +keyboard + +keyboard + + +keyboard--stdin + +default + + + diff --git a/novice/shell/img/04-loop.gv b/novice/shell/img/04-loop.gv new file mode 100644 index 000000000..d6bd7628c --- /dev/null +++ b/novice/shell/img/04-loop.gv @@ -0,0 +1,10 @@ +graph G { + rankdir=LR; + subgraph cluster_0 { + color=blue; + for -- variable -- in -- values -- do -- body -- done; + variable [shape=square]; + values [shape=square]; + body [shape=square, label="echo $path;\ncp $path backup-$path;\n..."]; + } +} \ No newline at end of file diff --git a/novice/shell/img/04-loop.gv.svg b/novice/shell/img/04-loop.gv.svg new file mode 100644 index 000000000..7a937d83b --- /dev/null +++ b/novice/shell/img/04-loop.gv.svg @@ -0,0 +1,77 @@ + + + + + + +G + +cluster_0 + + + +for + +for + + +variable + +variable + + +for--variable + + + +in + +in + + +variable--in + + + +values + +values + + +in--values + + + +do + +do + + +values--do + + + +body + +echo $path; +cp $path backup-$path; +... + + +do--body + + + +done + +done + + +body--done + + + + diff --git a/novice/shell/img/05-script.gv b/novice/shell/img/05-script.gv new file mode 100644 index 000000000..33071ae6c --- /dev/null +++ b/novice/shell/img/05-script.gv @@ -0,0 +1,14 @@ +graph G { + script [label="shell script"]; + running [shape=rect, label="$ bash script.sh"]; + positional_args [label="$1, $2, ..."]; + positional_example [shape=rect, label="$ bash middle.sh -5 -10 file.txt"]; + all_args [label="$*"]; + all_example [shape=rect, label="$ bash stats.sh ../data/*.dat"]; + comment [shape=rect, label="# comment"]; + + script -- running; + script -- positional_args -- positional_example; + script -- all_args -- all_example; + script -- comment; +} \ No newline at end of file diff --git a/novice/shell/img/05-script.gv.svg b/novice/shell/img/05-script.gv.svg new file mode 100644 index 000000000..803ca839e --- /dev/null +++ b/novice/shell/img/05-script.gv.svg @@ -0,0 +1,72 @@ + + + + + + +G + + +script + +shell script + + +running + +$ bash script.sh + + +script--running + + + +positional_args + +$1, $2, ... + + +script--positional_args + + + +all_args + +$* + + +script--all_args + + + +comment + +# comment + + +script--comment + + + +positional_example + +$ bash middle.sh -5 -10 file.txt + + +positional_args--positional_example + + + +all_example + +$ bash stats.sh ../data/*.dat + + +all_args--all_example + + + + diff --git a/novice/shell/img/06-find.gv b/novice/shell/img/06-find.gv new file mode 100644 index 000000000..3585e6eaa --- /dev/null +++ b/novice/shell/img/06-find.gv @@ -0,0 +1,9 @@ +graph G { + man; + subgraph cluster_1 { + label = "filters"; + color = blue; + grep; + } + grep -- "$(...)" -- find; +} \ No newline at end of file diff --git a/novice/shell/img/06-find.gv.svg b/novice/shell/img/06-find.gv.svg new file mode 100644 index 000000000..69d97e884 --- /dev/null +++ b/novice/shell/img/06-find.gv.svg @@ -0,0 +1,45 @@ + + + + + + +G + +cluster_1 + +filters + + +man + +man + + +grep + +grep + + +$(...) + +$(...) + + +grep--$(...) + + + +find + +find + + +$(...)--find + + + +