forked from gdichicago/intro-to-command-line
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
809 lines (657 loc) · 25 KB
/
index.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Intro to Command Line Interface - Girl Develop It</title>
<meta name="description" content="Girl Develop It framework for easily creating beautiful presentations using HTML in GDI theme. Forked from Hakim El Hattab's reveal.js">
<meta name="author" content="Girl Develop It">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/simple.css" id="theme">
<!-- For syntax highlighting -->
<!-- light editor -->
<link rel="stylesheet" href="lib/css/light.css">
<!-- dark editor <link rel="stylesheet" href="lib/css/dark.css">-->
<!-- <link rel="stylesheet" href="lib/css/zenburn.css"> -->
<link rel="stylesheet" href="plugin/accessibility-helper/css/accessibility-helper.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if (window.location.search.match(/print-pdf/gi)) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName('head')[0].appendChild(link);
}
</script>
<!-- If use the PDF print sheet so students can print slides-->
<link rel="stylesheet" href="css/print/pdf.css" type="text/css" media="print">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<!-- Opening -->
<section>
<img src="img/circle-gdi-logo.png" alt="GDI Logo" class="noborder" />
<h1>Introduction to the Command Line</h1>
</section>
<!-- Compatibility-->
<section>
<h2>Welcome!</h2>
<p>
Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.</p>
<h3>Some "rules":</h3>
<ul>
<li>We are here for you!</li>
<li>Every question is important</li>
<li>Help each other out</li>
<li>Have fun</li>
</ul>
</section>
<section>
<h2>Meet Your Instructor</h2>
<br>
<h3>Maureen McElaney</h3>
<p>@mo_mack</p>
</section>
<section>
<h2>Now it's all about you!</h2>
<ul>
<li>Tell us who you are.</li>
<li>What do you hope to get out of this class?</li>
</ul>
</section>
<section>
<h2>What we'll be covering in this class</h2>
<ul>
<li>Navigating and searching through files and directories</li>
<li class="fragment">Input/Output Redirection</li>
<li class="fragment">Installing Programs</li>
<li class="fragment">Changing file permissions and file ownership</li>
</ul>
</section>
<section>
<h2>What is a Shell?</h2>
<p><strong>A text-based command interpreter</strong></p>
<br>
<p>The most common shell is called BASH</p>
<p>For OS X, use a shell via the “Terminal” app</p>
</section>
<section>
<h2>The Shell</h2>
<img src="img/terminal.png" alt="The Terminal"/>
</section>
<section>
<h2>The Prompt</h2>
<p>Usually shows your username and computer name (hostname).</p><br>
<p>It indicates that the shell is ready for you to enter a command.</p>
</section>
<section>
<h2>Prompt</h2>
<img src="img/terminal-prompt.png" alt="The Prompt"/>
</section>
<section>
<h2>Command Structure</h2>
<pre><code class="html" contenteditable>$ command -options argument</code></pre>
<br/><p><em>Don’t forget to hit enter at the end of each command.</em></p>
</section>
<section>
<h2>Your First Command</h2>
<h3><code>echo</code></h3>
<p>Type <b><code>echo hello</code></b> to print <b>hello</b> to the screen</p>
</section>
<section>
<h2>Man Pages</h2>
<h3><code>man</code></h3>
<p>The <b><code>man</code></b> command brings up the manual for the specified command. Use <space> or the arrow keys to page through and press <b> q </b> to exit.</p>
<pre><code class="html ruby" contenteditable="">$ man ls</code></pre>
</section>
<section>
<h2>Love the Tab</h2>
<p>Tab completion autocompletes commands and filenames.</p>
<ul>
<li>Pressing <tab> once autocompletes a unique instance.</li>
<li>Pressing <tab> twice gives you all the options available.</li>
</ul>
<pre><code class="html" contenteditable="">$ cd P</code></pre>
</section>
<section>
<h2>The Current Directory</h2>
<h3><code>pwd</code></h3>
<h4>(Print Working Directory)</h4>
<br><p>Type it whenever you want to see what directory (folder) you’re in.</p>
</section>
<section>
<h2>pwd</h2>
<h4>(print working directory)</h4>
<img src="img/pwd.png" alt="pwd"/>
</section>
<section>
<h2>Directories</h2>
<h4>Containers for files or other directories.</h4><br/>
<p>Also referred to as "folders".</p><br/>
<p>Nested files and directories can be referenced using <em>paths</em>.</p>
</section>
<section>
<h2>File Paths</h2>
<h4>A sequence of nested directories, with a file or directory at the end.</h4><br/>
<p>Each directory or file is separated by a forward slash "/".</p><br/>
</section>
<section>
<h2>Two Types of Paths</h2><br>
<p><strong>Relative</strong>:<br> <code class="html" contenteditable>Desktop/dougthepug.jpg</code></p><br>
<p><strong>Absolute</strong>:<br> <code class="html" contenteditable>/Users/anastasialanz/Desktop/dougthepug.jpg</code></p>
</section>
<section>
<h2>Unix File Structure</h2>
<img src="img/unixfilestructure.gif" alt="Unix File Structure"/><br>
<br><p>In OS X, <strong><code>/home/you</code></strong> becomes <strong><code>/Users/you</code></strong></p>
</section>
<section>
<h2>File System Structure</h2>
<p>Varies between systems, but some common folders:</p>
<ul>
<li><strong>/bin</strong>: Basic commands</li>
<li><strong>/etc</strong>: System config files</li>
<li><strong>/tmp</strong>: Temporary files</li>
<li><strong>/usr</strong>: Regular user tools</li>
<li><strong>/usr/local</strong>: Installed user software</li>
<li><strong>/var</strong>: Data used by system</li>
</ul>
</section>
<section>
<h2>Shortcuts</h2>
<ul>
<li>Current Directory: (<b>.</b>)</li>
<li>Parent Directory: (<b>..</b>)</li>
<li>Home Directory: (<b>~</b>)</li>
<li>Root Directory: (<b>/</b>)</li>
</ul>
</section>
<section>
<h2>Change Directory</h2>
<h3><code>cd</code></h3>
<p>Use the <b><code>cd</code></b> command to change directories.</p><br/>
<p><em>Expects a file path as an argument.</em></p><br/>
<p>If no file path is given, it assumes your home directory (~) by default.</p>
</section>
<section>
<h2>cd</h2>
<h4>(change directory)</h4>
<img src="img/cd.png" alt="cd">
<p><em>There are 2 other ways that we could have gotten to our home directory...what are they?</em></p>
</section>
<section>
<h2>Clear your Terminal</h2>
<h3><code>clear</code></h3><br>
<p>The <b><code>clear</code></b> command clears the contents of the terminal and issues a prompt.</p>
<pre><code class="html" contenteditable>$ clear</code></pre>
<p><b>Option + L</b> will also clear the terminal.</p>
<aside class="notes">Feel free to use this whenever things get too cluttered.</aside>
</section>
<section>
<h2>List Directory</h2>
<h3><code>ls</code></h3>
<p>Use the <strong><code>ls</code></strong> command to list the contents of a directory.</p><br>
<p><em>Expects a file path as an argument.</em></p><br>
<p>If no file path is given, it assumes the current directory by default.</p>
</section>
<section>
<h2>ls</h2>
<h4>(list directory)</h4>
<img src="img/ls.png" alt="ls">
</section>
<section>
<h2>Flags</h2>
<h4>Some commands have additional options that you can specify by using flags.</h4><br>
<p>Flags are preceded by a hyphen, and are often a single character.</p>
<pre><code>$ ls -a</code></pre>
<pre><code>$ ls -l</code></pre>
</section>
<section>
<h2>ls -a</h2>
<h4>-a = show hidden files</h4>
<img src="img/ls-a.png" alt="ls -a" width="78%" height="78%">
<p><em>Notice that hidden file names begin with a "."</em></p>
</section>
<section>
<h2>ls -l</h2>
<h4>-l = use a “long list” format (shows more verbose output)</h4>
<img src="img/ls-l.png" alt="ls -l">
</section>
<section>
<h2>ls -al</h2>
<h4>Show hidden files and use a long list format</h4>
<img src="img/ls-al.png" alt="ls -al" width="72%" height="72%">
<p>You can combine flags or list them separately separated by spaces. (e.g. “ls -a -l”)</p>
</section>
<section>
<h2>File Names</h2>
<ul>
<li>case sensitive</li>
<li>any character (besides “/”)</li>
<li>file extensions are for user convenience</li>
</ul><br/><br/>
<p>Examples:</p>
<pre><code class="html" contenteditable>README .bashrc index.html index.html.old Bugs List.txt</code></pre>
</section>
<section>
<h2>Making and Removing Directories</h2>
<p>Use the <strong>mkdir</strong> command to create a new empty directory.</p><br>
<p>Use the <strong>rmdir</strong> command to remove an empty directory.</p><br>
<p>Use <strong>rm -r</strong> to remove a non-empty directory<br><em>...be careful!</em></p><br>
<p><em>All 3 commands expect the name of a directory as an argument.</em></p>
</section>
<section>
<h2>mkdir, rmdir</h2>
<h4>(make directory, remove directory)</h4>
<img src="img/makeremove.png" alt="mkdir, rmdir">
</section>
<section>
<h2>Develop it!</h2>
<h3>Exercise 1</h3>
<ol>
<li>Change to your home directory desktop</li>
<li>Create a <b>gdi/burlington</b> directory path</li>
<li>Navigate into the <b>gdi/burlington</b> directory</li>
<li>Create a <b>CLI</b> directory</li>
<li>View the contents of the <b>CLI</b> directory</li>
<li>Navigate up two directories</li>
<li>Use the <b>pwd</b> command to verify you are home</li>
</ol>
</section>
<section>
<h2>Create a File</h2>
<h3><code>touch</code></h3>
<p>Use the <b>touch</b> command to create a new file.</p><br>
<p><em>The touch command expects the name of your new file as an argument.</em></p>
</section>
<section>
<h2>touch</h2>
<h4>(create a file)</h4>
<img src="img/touch.png" alt="touch">
</section>
<section>
<h2>Copy a File</h2>
<h3><code>cp</code></h3>
<p>Use the <b>cp</b> command to copy a file.</p><br>
<p>The <b>cp</b> command takes two arguments:</p>
<p>1st argument = the "origin" file</p>
<p>2nd argument = the "destination" file</p>
<pre><code class="html" contenteditable>$ cp resume.txt resume-copy.txt</code></pre>
</section>
<section>
<h2>cp</h2>
<h4>(copy a file)</h4>
<h5><code class="html" contenteditable>$ cp orig dest</code></h5>
<img src="img/cp.png" alt="cp">
</section>
<section>
<h2>Copy a Directory</h2>
<h3><code>cp -R</code></h3>
<p>Use the <b>cp -R</b> command to copy a directory.</p><br>
<p>The <b>cp -R</b> command takes two arguments:</p>
<p>1st argument = the "origin" directory</p>
<p>2nd argument = the "destination" directory</p>
<pre><code class="html" contenteditable>$ cp -R homework old-homework</code></pre>
</section>
<section>
<h2>cp -R</h2>
<h4>(copy a directory)</h4>
<h5><code class="html" contenteditable>$ cp -R orig dest</code></h5>
<img src="img/cp-R.png" alt="cp-R">
</section>
<section>
<h2>Moving (or renaming) a File/Directory</h2>
<p>Use the <b>mv</b> command to move a file or directory.</p><br>
<p>The <b>mv</b> command takes two arguments:</p>
<p>1st argument = the "origin"</p>
<p>2nd argument = the "destination"</p>
</section>
<section>
<h2>Move a File/Directory</h2>
<h3><code>mv orig dest</code></h3>
<img src="img/mvfile.png" alt="move file/directory">
</section>
<section>
<h2>Rename a File/Directory</h2>
<h3><code>mv orig dest</code></h3>
<img src="img/renamefile.png" alt="rename file/directory">
</section>
<section>
<h2>Remove a File</h2>
<h3><code>rm</code></h3>
<p>Use the <b>rm</b> command to remove a file.</p><br>
<p><em>Expects the name of the file you are removing as an argument.</em></p>
</section>
<section>
<h2>rm</h2>
<h4>(remove a file)</h4>
<img src="img/rmfile.png" alt="remove a file">
</section>
<section>
<h2>Develop it!</h2>
<h3>Exercise 2</h3>
<ol>
<li>Create a folder called <b>gdi</b></li>
<li>Make that folder your current working directory</li>
<li>Create two files: <b>file1.txt</b>, <b>file2.txt</b></li>
<li>Copy <b>file1.txt</b> and call the copy <b>file3.txt</b></li>
<li>Create a directory called <b>folder1</b></li>
<li>Move <b>file1.txt</b> into <b>folder1</b></li>
<li>List the contents of <b>folder1</b> without going into it</li>
<li>Rename <b>file1.txt</b> to <b>myfile.txt</b></li>
<li>Clear your terminal</li>
</ol>
</section>
<section>
<h2>View a File</h2>
<h3><code>cat, more, less</code></h3>
<p>Use the <b>cat</b> command to output (catenate) the contents of a file to the console.</p><br>
<p>Use the <b>more</b> or <b>less</b> commands to read a file:</p>
<ul>
<li><b>more</b> allows you to step through the contents of a file a screen at a time</li>
<li><b>less</b> allows you to step backwards or forwards</li>
<ul>
<li>Press <b>q</b> to exit out of this mode</li>
</ul>
</ul>
</section>
<section>
<h2>cat</h2>
<h4>(catenate)</h4>
<p><em>will output the entire file</em></p>
<img src="img/cat.png" alt="cat">
</section>
<section>
<h2>more</h2>
<img src="img/more.png" alt="more">
</section>
<section>
<h2>less</h2>
<img src="img/less.png" alt="less">
</section>
<section>
<h2>Edit a File</h2>
<p>You can use various editors built into bash:</p>
<p><code>$ vi myfile.txt</code></p>
<p><code>$ emacs myfile.txt</code></p>
<p><code>$ pico myfile.txt</code></p><br>
<p>Or on a Mac, you can open with any desktop app:</p>
<pre><code class="html" contenteditable>$ open -a TextEdit myfile.txt</code></pre>
<p>Or with the default editor:</p>
<pre><code class="html" contenteditable>$ open -t myfile.txt</code></pre>
</section>
<section>
<h2>Search within a File</h2>
<h3><code>grep</code></h3>
<p>Use the <b>grep</b> command to search in files.</p><br>
<p>The grep command outputs only the lines in a file that match a given pattern.</p><br>
<p>The 1st argument is the pattern to match, and the 2nd, 3rd, and so on are the files to search within.</p>
<pre><code class="html" contenteditable>$ grep pattern file</code></pre>
</section>
<section>
<h2>grep</h2>
<h4>(search within a file for text that matches a pattern)</h4>
<img src="img/grep.png" alt="grep">
</section>
<section>
<h2>Wildcard Matching</h2>
<p>Use the <b>*</b> (asterisk) symbol to match <em>anything</em>.</p><br>
<p>You can use this to search through all of a particular file type.</p>
<pre><code class="html" contenteditable>$ grep hello *.txt</code></pre><br>
<p>The shell will build a list of all the files that match the non-asterisk part.</p>
</section>
<section>
<h2>Finding Files</h2>
<h3><code>find</code></h3>
<p>Use the <b>find</b> command to find files according to name/metadata.</p><br>
<p>Find all txt files under the current directory:</p>
<pre><code class="html" contenteditable>find . -name '*.txt' -print</code></pre>
</section>
<section>
<h2>find</h2>
<h4>(finding files)</h4>
<img src="img/find.png" alt="find">
</section>
<section>
<h2>Redirecting Output</h2>
<p>By default, input comes from the screen and output goes to the screen.</p><br>
<p>You can use <b><</b> and <b>></b> to redirect input/output.</p><br>
<p>A practical example: Save results of search in a file:</p>
<pre><code class="html" contenteditable>grep hello *.txt > results.txt</code></pre>
</section>
<section>
<h2>Redirecting Output</h2>
<img src="img/redirection.png" alt="redirection">
</section>
<section>
<h2>Redirecting Output</h2>
<p>Use the <b>echo</b> command to add a new line of text.</p><br>
<p>Use the <b>></b> to <em>replace</em> the contents of a file.</p><br>
<p>Use the <b>>></b> to <em>add to</em> the end of a file.</p>
</section>
<section>
<h2>Redirecting Output</h2>
<img src="img/echo.png" alt="redirection">
</section>
<section>
<h2>Develop it!</h2>
<h3>Exercise 3</h3>
<ol>
<li>In the <b>gdi</b> directory, output the contents of <b>file2.txt</b> to the terminal</li>
<li>Add <a href="http://www.lipsum.com/" target="_blank">a sentence</a> to <b>file2.txt</b></li>
<li>Add a few more sentences to <b>file2.txt</b></li>
<li>Search the file for the word of your choice and add the results to <b>file3.txt</b></li>
</ol>
</section>
<section>
<h2>Command Line Movement</h2>
<ul>
<li><b>ctrl-a</b>: jump to beginning of line</li>
<li><b>ctrl-e</b>: jump to end of line</li>
<li><b>ctrl-u</b>: clear the line</li>
<li><b>ctrl-l</b>: shortcode for clear</li>
<li><b>ctrl-r</b>: search previous commands</li>
<li><b>ctrl-c</b>: get out of trouble</li>
<li><b>ctrl-d</b>: exit terminal</li>
</ul>
</section>
<section>
<h2>More Command Line Movement</h2>
<ul>
<li>The <b>left/right arrow keys</b> let you edit within a command</li>
<li>The <b>up/down arrow keys</b> let you select previous commands</li>
<li><b>tab</b> auto-completes filenames</li>
</ul><br><br>
<p>Lots more, and you can create your own.</p>
</section>
<section>
<h2>Command Line History</h2>
<p>Use the <b>history</b> command to see a list of all your previous commands.</p><br>
<p>Each command will be listed next to a line number.</p><br>
<p>A few history-related commands:</p>
<ul>
<li><b>!!</b>: Latest command</li>
<li><b>!568</b>: Command by line #</li>
<li><b>!open</b>: Command matching string</li>
</ul>
</section>
<section>
<h2>history</h2>
<img src="img/history.png" alt="history">
</section>
<section>
<h2>Develop it!</h2>
<h3>Exercise 4</h3>
<ol>
<li>Use your up and down arrows to locate a past command with one or more arguments</li>
<li>Jump to the beginning of the line</li>
<li>Jump to the end of the line</li>
<li>Look at your command line history</li>
<li>Begin to type a previous command and experiment with using tab to complete it</li>
</ol>
</section>
<section>
<h2>curl</h2>
<p>A command line tool for getting or sending files using URL syntax.</p>
<pre><code class="html" contenteditable>$ which curl</code></pre>
<aside class="notes">Type the above command to see if you have curl installed. If it's blank, you need to look up how to install curl on your operating system.</aside>
</section>
<section>
<h2>Download a file with curl</h2>
<p>The command below will download a .txt file</p>
<pre><code class="html" contenteditable>$ curl -OL example.com/pugs.txt</code></pre>
</section>
<section>
<h2>head</h2>
<p>Shows the first 10 lines of a file.</p>
<img src="img/head.png" alt="head command">
</section>
<section>
<h2>tail</h2>
<p>Shows the last 10 lines of a file.</p>
<img src="img/tail.png" alt="tail command">
</section>
<section>
<h2>wc</h2>
<h3>(Word count)</h3>
<p>This command shows newline count, word count and byte count.</p>
<img src="img/wc.png">
</section>
<section>
<h2>Pipe</h2><br>
<p>The output of one command is the input of another command.</p><br>
<pre><code class="html">$ head cat.txt | wc</code></pre><br>
<p>Use this command to chain multiple commands together.</p>
</section>
<section>
<h2>Develop it!</h2>
<h3>Exercise 5</h3>
<ol>
<li>Download the cat.txt file by running this command:<pre><code class="html" contenteditable>$ curl -OL gdibtv.github.io/intro-to-command-line/cat.txt</code></pre></li>
<li>Use the <b>head</b> command to see the first 10 lines of text.</li>
<li>Use the <b>tail</b> command to see the last 10 lines of text.</li>
<li>Pipe the results of <b>grep cat cat.txt</b> command through <b>wc</b> to count the number of times "cat" appears.</li>
<li>Using the <b>grep</b> man page, find the option for case insensitive matching. Try to find how many times "cat" and "Cat" appear.</li>
</ol>
</section>
<!-- <section>
<h2>File Permissions</h2>
<p>Files in UNIX have owner, group and other permissions.</p>
<p><b>owner permissions</b></p>
<aside class="notes">Most file systems have methods to assign permissions or access rights to specific users and groups of users. These systems control the ability of the users to view, change, navigate, and execute the contents of the file system.</aside>
</section> -->
<section>
<h2>Installing Programs</h2>
<p>Use <a href="http://brew.sh/" target="_blank">Homebrew</a> for MacOs.</p>
<p>Use apt-get for Ubuntu.</p>
</section>
<section>
<h2>cowsay</h2>
<p>A program that generates ASCII pictures of cows with a message.</p>
<pre><code class="html" contenteditable>$ brew install cowsay</code></pre>
<img src="img/cowsay.png">
</section>
<section>
<h2>Extras</h2>
<h3>Open a URL in the browser with command line</h3>
<pre><code class="html" contenteditable>$ open http://girldevelopit.com</code></pre>
</section>
<section>
<h2>Extras</h2>
<h3>Make your computer talk from the command line</h3>
<pre><code class="html" contenteditable>$ say i love the command line</code></pre>
</section>
<section>
<h2>Develop it!</h2>
<ol>
<li>Install cowsay on your environment.</li>
<li>Use the cowsay man page to list the different cowfiles.</li>
<li>Generate 5 different cowsay cowfiles pictures using the <b>- f</b> option.</li>
<li>Open a url of your choice from the command line.</li>
<li>Use the man pages and find a different voice output for the say command.</li>
</ol>
</section>
<section>
<h2>Free Resources</h2>
<ul>
<li><a href="https://www.learnenough.com/command-line-tutorial" target="_blank">Learn Enough Command Line to Be Dangerous</a></li>
<li><a href="https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-0" target="_blank">edX course on Linux</a></li>
<li><a href="https://www.codecademy.com/learn/learn-the-command-line" target="_blank">CodeCademy course on Command Line</a></li>
<li><a href="http://linuxcommand.org/lc3_learning_the_shell.php" target="_blank">Learning the shell</a></li>
</ul>
</section>
<section>
<h2>Thanks!</h2>
<h3>Maureen McElaney</h3>
<h4>[email protected]</h4>
<h4><a href="https://twitter.com/mo_mack">@mo_mack</a></h4>
</section>
</div>
<footer>
<div class="copyright">
Introduction to Command Line Interface -- Girl Develop It Burlington --
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>
</div>
</footer>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [{
src: 'lib/js/classList.js',
condition: function() {
return !document.body.classList;
}
}, {
src: 'plugin/markdown/marked.js',
condition: function() {
return !!document.querySelector('[data-markdown]');
}
}, {
src: 'plugin/markdown/markdown.js',
condition: function() {
return !!document.querySelector('[data-markdown]');
}
}, {
src: 'plugin/highlight/highlight.js',
async: true,
condition: function() {
return !!document.querySelector('pre code');
},
callback: function() {
hljs.initHighlightingOnLoad();
}
}, {
src: 'plugin/zoom-js/zoom.js',
async: true
}, {
src: 'plugin/notes/notes.js',
async: true
}, {
src: 'plugin/accessibility-helper/js/accessibility-helper.js',
async: true,
condition: function() {
return !!document.body.classList;
}
}]
});
</script>
</body>
</html>