Skip to content

Commit

Permalink
updates from bash book
Browse files Browse the repository at this point in the history
  • Loading branch information
cuttlefishh committed Jan 11, 2018
1 parent d23397e commit a0e35fb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
15 changes: 15 additions & 0 deletions data/survey_scores_2015_T.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
subject_id,computer_has,computer_os,score_bash,score_command,score_matlab,score_perl,score_python,score_r
10000,N,,0,0,0,0,0,0
13001,Y,Mac,1,2,3,0,0,0
60985,Y,Windows,0,1,1,0,2,1
43309,Y,Mac,3,3,0,0,1,2
89785,Y,Windows,2,2,0,1,2,2
57688,Y,Mac,1,1,1,0,0,0
19366,Y,Mac,0,2,3,0,0,2
97775,Y,Mac,2,2,3,0,1,0
22384,Y,Windows,0,0,2,0,0,2
31556,Y,Mac,1,2,3,0,0,0
70964,Y,Mac,1,1,2,0,1,2
70155,Y,Linux,1,1,1,0,1,0
47724,Y,Mac,0,0,1,0,0,0
37602,Y,Linux,2,2,0,1,1,2
28 changes: 23 additions & 5 deletions lessons/lesson02.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Skills you will learn in this lesson:

* `pwd` -- print working directory
* `ls` -- list contents of working directory
* `cd DIRECTORY` or `cd` -- change directory, change to home directory
* `cd DIRECTORY` -- change to directory
* `cd` -- change to home directory
* `cd -` -- change to previous directory
* `mkdir DIRECTORY` -- make directory
* `rmdir DIRECTORY` -- remove empty directory
* `touch FILE` -- create an empty file
Expand All @@ -34,6 +36,7 @@ Skills you will learn in this lesson:
#### Working with commands and processes

* `man COMMAND` -- display manual page of command if it exists
* `help COMMAND` -- display help description of command if it exists
* `which COMMAND` -- show location of command
* `history` -- display past commands
* `top` -- display current processes
Expand Down Expand Up @@ -114,8 +117,6 @@ alias taill='ls -lrt | tail'
* `<` -- get output of file (other type of redirect)
* `` `COMMAND` `` -- pass output of a command (e.g., in a for loop)

### Paths and variables

#### Absolute and relative paths, symbolic links

* `.` -- current directory
Expand All @@ -125,6 +126,25 @@ alias taill='ls -lrt | tail'
* `~` -- home directory
* `ln -s FILE LINK` -- make a symbolic link

#### Wildcards

* `?` - match any single character
* `*` - match any string of characters
* `[set]` - match any character in set
* `[!set]` - match any character *not* in set

#### Brace expansion

* `{start..end}` - expand a range; e.g., `b{ed,olt,ar}s`, `{2..5}`, `{d..h}`

#### Control keys

* `CTRL-C` - stop current command
* `CTRL-D` - end of input
* `CTRL-Z` - suspend current command

### Variables, bash scripts, and dot-files

#### Bash variables and commands

* `A=0` -- assign a variable
Expand All @@ -136,8 +156,6 @@ alias taill='ls -lrt | tail'
* `$HOME` -- your home directory (another name for `~` or `/Users/you`)
* `for VARIABLE in LIST; do COMMANDS; done` -- `for` loop in bash

### Executing bash scripts and dot-files

#### Commands

* `bash SCRIPT.sh` -- run a bash shell script
Expand Down

0 comments on commit a0e35fb

Please sign in to comment.