forked from swcarpentry/DEPRECATED-bc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshell.html
158 lines (152 loc) · 4.13 KB
/
shell.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
layout: slides
title: "Software Carpentry: The Unix Shell"
root: ..
datetime: June 2014
website: http://software-carpentry.org
---
<section>
<h2> </h2>
<img src="{{page.root}}/img/software-carpentry-large.png" alt="Software Carpentry logo" />
<h1>The Unix Shell</h1>
<aside class="notes">
Over the next two and a half hours,
we will introduce you to the Unix shell.
It's older than most people in this room,
but there are good reasons why it's lasted forty-five years.
</aside>
</section>
<section>
<h1>What It Is</h1>
<ul>
<li>
A generic textual interface for your computer.
</li>
<li class="fragment">
Runs other programs for you.
</li>
<li class="fragment">
Saves you time.
</li>
</ul>
<aside class="notes">
The shell is basically a generic textual interface for your computer.
When you type the name of a program,
the shell finds it for you,
runs it,
and shows you its output.
Once you're familiar with it,
this lets you do complex things with a few keystrokes.
</aside>
</section>
<section>
<h1>Reproducibility</h1>
<ul>
<li>
Records the commands you type.
</li>
<li class="fragment">
So you can inspect and repeat them later.
</li>
<li class="fragment">
An electronic lab notebook.
</li>
</ul>
<aside class="notes">
But the shell does more than that.
For example,
it saves all the commands that you type
so that you can look at them later to figure out what you did,
or ask the computer to repeat them.
It can therefore be used as a simple electronic lab notebook
without any extra effort.
</aside>
</section>
<section>
<h1>Automation</h1>
<ul>
<li>
Repeat commands once per file/per hour/per parameter.
</li>
<li class="fragment">
The computer can do science while you're asleep.
</li>
</ul>
<aside class="notes">
And if the computer can repeat a command once,
it can repeat it many times
to process different data files,
explore variations in parameters,
or do something at regular intervals.
This means that the computer can do science for you while you're asleep
or catching up on your reading.
</aside>
</section>
<section>
<h1>Glue</h1>
<ul>
<li>
A simple way to combine other programs.
</li>
<li class="fragment">
Re-use instead of rewriting.
</li>
</ul>
<aside class="notes">
Finally,
the shell is often used to combine programs written by different people,
at different times,
in different languages.
This means that you don't have to learn Fortran, Perl, or C++
to use tools written in those languages.
Instead,
you can concentrate on building new things that do new kinds of science.
</aside>
</section>
<section>
<h1>But</h1>
<ul>
<li>
Syntax isn't simple or consistent.
</li>
<li class="fragment">
With great power comes great responsibility.
</li>
</ul>
<aside class="notes">
Nothing's perfect, though.
Many of the shell's commands have cryptic two- and three-letter names,
and the online help is written for people who already understand how it works.
More importantly,
the shell is a power tool:
if you accidentally tell it to delete your thesis,
it will.
</aside>
</section>
<section>
<h1>Syllabus</h1>
<div class="row-fluid">
<div class="span6">
<ol>
<li>Files and directories</li>
<li>History</li>
<li>Combining programs</li>
<li>Repeating things</li>
<li>Creating new commands</li>
<li>Finding things</li>
</ol>
</div>
<div class="span6 fragment">
<img src="{{page.root}}/img/books/ray-ray-unix-linux.png" alt="Unix and Linux: Visual QuickStart Guide cover" />
</div>
</div>
<aside class="notes">
We will only explore a dozen or so commands in this lesson.
Our real goal is to teach you how the shell works
and how best to use it.
If you'd like to know more,
we recommend Deborah and Eric Ray's
<em>Unix and Linux: Visual QuickStart Guide</em>,
which is good both as a tutorial and as a reference.
</aside>
</section>