forked from girldevelopit/gdi-slides-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
841 lines (742 loc) · 29.4 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
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Intro to Command Line</title>
<meta name="description" content="Girl Develop It official Intro to Command Line curriculum">
<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/gdilight.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>
<h2>Intro to Command Line</h2>
<img src="img/circle-gdi-logo.png" alt="GDI Logo"/>
<!-- Link to where your slides are hosted here.
<p>
<small>Found at <a href ="http://<username>.github.io/<repositoryname>"></a>http://username.github.io/repositoryname</small>
</p>
-->
</section>
<section>
<h2>Welcome!</h2>
<div>
<p>Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.</p>
</div>
<br>
<h4>Some "rules"</h4>
<ul>
<li>We are here for you!</li>
<li>Every question is important</li>
<li>Help each other</li>
<li>Have fun</li>
</ul>
</section>
<section>
<h2>Welcome!</h2>
<br>
<h4>Tell us about yourself.</h4>
<ul>
<li>Who are you?</li>
<li>What do you hope to get out of the class?</li>
<!-- Feel free to change the icebreaker question! -->
<li>Why do you live in this area?</li>
</ul>
</section>
<section>
<h2>Agenda</h2>
<h6>This class will be a combo of lecture + exercises</h6>
<ul>
<li class="fragment">Command line "lingo"</li>
<li class="fragment">Working with folder directories</li>
<li class="fragment">Working with files</li>
<li class="fragment">Standard input/output</li>
<li class="fragment">Working with commands</li>
<li class="fragment">Running and stopping processes</li>
<li class="fragment">Real world examples</li>
</ul>
</section>
<section>
<h2>The "lingo"</h2>
<ul>
<li class="fragment">"Terminal"</li>
<li class="fragment">"Command-line"</li>
<li class="fragment">"Command prompt"</li>
<li class="fragment">"Shell"</li>
<li class="fragment">"Console"</li>
</ul>
<br><br>
<p class="fragment">These are all pretty much the same thing.</p>
</section>
<section>
<h2>What is a Terminal?</h2>
<br>
<p>A text-based command interpreter.</p>
<br>
<p>The most common shell is "bash".</p>
<br>
<p>For Mac's OSX, use the "Terminal" application.</p>
</section>
<section>
<h2>Fire it up!</h2>
<p>Windows: Download <a href="https://git-for-windows.github.io/index.html">Git for Bash</a>, then open <code>Git BASH</code></p>
<p>Mac: Open <code>Terminal</code></p>
<img src="img/command-line-blank.png" alt="Black Command Line">
</section>
<section>
<h2>Prompt</h2>
<img src="img/command-line-prompt.png" alt="Command Line prompt">
</section>
<section>
<h2>Prompt</h2>
<br>
<p>Usually shows your username and computer name.</p>
<br>
<p>Indicates that the terminal is ready for a command.</p>
</section>
<section>
<h2>Cursor</h2>
<img src="img/command-line-cursor.png" alt="Command Line cursor">
</section>
<section>
<h2>Cursor</h2>
<br>
<p>Indicates your current spot in the terminal.</p>
<br>
<p>Shows you where the stuff you type will go.</p>
</section>
<section>
<h2>Your First Command</h2>
<br>
<ol>
<li>Type <code>pwd</code> into your terminal.</li>
<li>Press the enter key.</li>
</ol>
</section>
<section>
<h2>Your First Command</h2>
<p><code>pwd</code></p>
<img src="img/command-line-pwd.png" alt="Your first command, pwd">
</section>
<section>
<h2>clear</h2>
<br>
<p>The <code>clear</code> command clears the contents of the terminal and issues a prompt.</p>
<br>
<p>This is good for removing previous output that is unnecessary to the task at hand.</p>
<br>
<p>Feel free to use this whenever things get too cluttered.</p>
</section>
<section>
<h2>Directories</h2>
<br>
<p>Also referred to as "folders".</p>
<br>
<p>A container for files or other directories.</p>
<br>
<p>Nested files and directories can be referenced using <code>paths</code>.</p>
</section>
<section>
<h2>Directory Trees</h2>
<br>
<p>The set of all folders, taken together, makes up your entire file system.</p>
<br>
<p>This system is organized into a kind of upside down tree.</p>
</section>
<section>
<h2>Directory Tress</h2>
<p>At the very top of the tree is the root folder.</p>
<br>
<img src="img/unix-filesystem.png" alt="Unix file directory system">
</section>
<section>
<h2>Paths</h2>
<br>
<p>Each directory or file is separated by a forward slash "/"</p>
<br>
<p>There are two kinds of paths:</p>
<br>
<ul>
<li>Relative: <code>Desktop/the_project/overview.txt</code></li>
<li>Absolute: <code>/Users/jane/Desktop/logo.png</code></li>
</ul>
</section>
<section>
<h2>Shortcuts</h2>
<br>
<ul>
<li>Current Directory: <code>.</code></li>
<li>Parent Directory: <code>..</code></li>
<li>Home Directory: <code>~</code></li>
</ul>
</section>
<section>
<h2>cd</h2>
<br>
<p>The <code>cd</code> command changes the current working directory.</p>
<br>
<p>It expects a file path as an "argument".</p>
<br>
<p>If no file path is given, it assumes your home directory by default.</p>
</section>
<section>
<h2>cd</h2>
<img src="img/command-line-cd.png" alt="Command line cd">
</section>
<section>
<h2>ls</h2>
<br>
<p>The <code>ls</code> command lists the contents of a directory.</p>
<br>
<p>It expects a file path as an "argument".</p>
<br>
<p>If no file path is given, it assumes the current directory by default.</p>
</section>
<section>
<h2>ls</h2>
<img src="img/command-line-ls.png" alt="Command line ls">
</section>
<section>
<h2>Flags</h2>
<br>
<p>The <code>ls</code> command accepts several option flags.</p>
<br>
<p>A flag is a special argument that is used to set an option for the command.</p>
<br>
<p>These are commonly a hyphen followed by a single character (e.g. <code>-g</code>)</p>
<br>
<p>Setting the <code>-l</code> flag on the <code>ls</code> command causes it to provide more verbose output.</p>
</section>
<section>
<h2>ls -l</h2>
<img src="img/command-line-ls-flags.png" alt="Command line ls with flags">
</section>
<section>
<h2>cd & ls</h2>
<br>
<p>Play with the <code>cd</code> and <code>ls</code> commands.</p>
<br>
<h4>Be sure to incorporate:</h4>
<ul>
<li>relative file path</li>
<li>absolute file path</li>
<li>the <code>.</code> shortcut</li>
<li>the <code>..</code> shortcut</li>
<li>the <code>~</code> shortcut</li>
<li><code>cd</code> without an argument</li>
</ul>
<br><br>
<p>Use <code>pwd</code> to check your location periodically.</p>
</section>
<section>
<h2>Making a Directory</h2>
<br>
<p>Use the <code>mkdir</code> command to create a new empty directory.</p>
<br>
<p>Pass the path of the directory name as the first argument.</p>
<br>
<p class="fragment">If the base of the path doesn't already exist, the command will fail.</p>
<br>
<p class="fragment">Use the <code>-p</code> flag to create the full path if non-existent.</p>
</section>
<section>
<h2>mkdir</h2>
<img src="img/command-line-mkdir.png" alt="Command line make directory">
</section>
<section>
<h2>Removing Directories</h2>
<br>
<p>Use the <code>rmdir</code> command to remove an empty directory.</p>
<br>
<p>Use <code>rm -r</code> to remove a non-empty directory.</p>
</section>
<section>
<h2>rmdir</h2>
<img src="img/command-line-rmdir.png" alt="Command line remove directory">
</section>
<section>
<h2>Let's Develop It!</h2>
<br>
<ol>
<li><code>cd</code> to your home directory.</li>
<li>Create the <code>girl/develop</code> directory path.</li>
<li>Navigate into the <code>girl/develop</code> directory.</li>
<li>Create the <code>it</code> directory.</li>
<li>Navigate up two directories.</li>
<li>Use the <code>pwd</code> command to verify you are home.</li>
<li>Remove the <code>girl/develop/it</code> path.</li>
</ol>
</section>
<section>
<h2>Let's Develop It</h2>
<img src="img/exercise1-answer.png" alt="Exercise 1 answer">
</section>
<section>
<h2>Files</h2>
<br>
<p>Use <code>cat</code> to output the contents of a file to the console.</p>
<br>
<p>Use <code>more</code> to step through the contents of a file one screen at a time.</p>
<br>
<p>Use <code>less</code> to step backwards or forwards.</p>
</section>
<section>
<h2>Let's Develop It!</h2>
<br>
<p>Explore the <code>/usr/share/misc</code> files using <code>cat</code>, <code>more</code>, and <code>less</code></p>
<br>
<p>Can you find your birth month's stone and flower in the <code>birthtoken</code> file?</p>
</section>
<section>
<h2>Let's Develop It!</h2>
<img src="img/exercise2-answer.png" alt="Exercise 2 answer">
</section>
<section>
<h2>Hidden Files</h2>
<br>
<p>Filenames that begin with a period are hidden from normal output.</p>
<br>
<p>e.g. ".bashrc"</p>
<br>
<p>Use the <code>ls</code> command with the <code>-a</code> flag to see hidden files in addition to the usual output.</p>
<br>
<p>Type <code>ls -la</code> into your terminal.</p>
<br>
<p>Use the <code>-h</code> flag to get human readable file sizes.</p>
</section>
<section>
<h2>ls -la</h2>
<img src="img/command-line-hidden-files.png" alt="Command line hidden files using flag -la">
</section>
<section>
<h2>Creating and Removing Files</h2>
<br>
<p>Use <code>touch</code> to create a blank file or update the timestamp on an existing file.</p>
<br>
<p>Use <code>rm</code> to remove files.</p>
</section>
<section>
<h2>Permissions</h2>
<br>
<div class="left-align">
<p>The unix security model breaks up file permissions into three groups:</p>
<br>
<ol>
<li>Owner</li>
<li>Group</li>
<li>Others</li>
</ol>
<br><br>
<table>
<thead>
<tr>
<td>
<h3><code>rwx</code></h3>
</td>
<td>
<h3><code>r-x</code></h3>
</td>
<td>
<h3><code>r-x</code></h3>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
owner
</td>
<td>
group
</td>
<td>
others
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2>Changing Permissions</h2>
<br>
<p>Use <code>chmod</code> to change permissions on a file/directory</p>
<br>
<h4>The argument has three sections:</h4>
<ol>
<li class="fragment"><code>u</code>, <code>g</code>, <code>o</code> to signify which level to target.</li>
<li class="fragment"><code>+</code> or <code>-</code> to indicate whether adding or removing.</li>
<li class="fragment"><code>r</code>, <code>w</code>, <code>x</code> to indicate what type of permission to change.</li>
</ol>
<br><br>
<h4 class="fragment">Examples:</h4>
<p class="fragment"><code>chmod u+w</code> to add write permissions for the file's owner.</p>
<p class="fragment"><code>chmod go-rwx</code> to remove all permissions for the file's group and everyone else.</p>
</section>
<section>
<h2>Let's Develop It!</h2>
<br>
<ol>
<li>Create a new file named <code>testfile</code> in your home directory.</li>
<li>Grant yourself execute permission on the file.</li>
<li>Remove read permission on <code>testfile</code> from your group and everyone else.</li>
<li>Delete <code>testfile</code>.</li>
</ol>
</section>
<section>
<h2>Let's Develop It!</h2>
<img src="img/exercise3-answer.png" alt="Exercise 3 Example">
</section>
<section>
<h2>Standard Output</h2>
<br>
<p>Most commands display their results to a mechanism called the standard output.</p>
<br>
<p>By default, this directs its content to the display.</p>
<br>
<p class="fragment">The standard output can be redirected to a file using the <code>></code> operator.</p>
<br>
<p class="fragment"><code>ls > file_list.txt</code></p>
</section>
<section>
<h2>Standard Output</h2>
<br>
<p>In order to append to the file instead of overwriting it, use the <code>>></code> operator instead.</p>
<br>
<p><code>ls >> file_list.txt</code></p>
<br>
<p class="fragment">Both the <code>></code> and <code>>></code> operator will create the file if it doesn't exist.</p>
</section>
<section>
<h2>Standard Input</h2>
<br>
<p>Whenever commands accept keyboard input, it's likely they are really just drawing input from a mechanism called standard input.</p>
<br>
<p>By default, this is set to keyboard input.</p>
<br>
<p>The input to a command can be redirected to a file by using the <code><</code> operator.</p>
<br>
<p><code>sort < file_list.txt</code></p>
<br>
<p class="fragment">Both input and output can be redirected at the same time.</p>
<br>
<p class="fragment"><code>sort < file_list.txt > sorted_file_list.txt</code></p>
</section>
<section>
<h2>Pipes</h2>
<br>
<p>The "|" character can be used to allow commands to communicate during execution.</p>
<br>
<p>Pipes are placed between commands.</p>
<br>
<p>A pipe will cause the output of the left command to be used as the input of the right command.</p>
<br>
<p><code>ls -l | grep "myfile.txt" du | sort -nr</code></p>
</section>
<section>
<h2>grep</h2>
<br>
<p>The <code>grep</code> command outputs only the lines from a file that match a given pattern.</p>
<br>
<p>This is useful for doing text searches within a file.</p>
<br>
<p>The first argument is the pattern to match. The second, third, and so on are files to search within.</p>
<br>
<p><code>grep "ls" .bash_history</code></p>
<br>
<p class="fragment">If no file argument is given, it
will expect input from the keyboard.</p>
</section>
<section>
<h2>Filters</h2>
<br>
<h4>Filters are commands whose behavior follows the following pattern:</h4>
<ol>
<li>Accept input from standard input.</li>
<li>Perform some operation on it.</li>
<li>Send the results to standard output.</li>
</ol>
</section>
<section>
<h2>Filters</h2>
<p>Check out the man pages for the following:</p>
<br>
<p><code>sort</code></p>
<p><code>uniq</code></p>
<p><code>grep</code></p>
<p><code>head</code></p>
<p><code>tail</code></p>
<p><code>fmt</code></p>
<p><code>pr</code></p>
<p><code>tr</code></p>
<p><code>sed</code></p>
<p><code>awk</code></p>
</section>
<section>
<h2>Let's Develop It!</h2>
<br>
<p>Use the <code>ls</code> and <code>grep</code> commands to print out only the files in your home directory that contain the word "bash".</p>
</section>
<section>
<h2>Let's Develop It!</h2>
<br>
<p><code>ls -a | grep bash</code></p>
<img src="img/exercise4-answer.png" alt="Exercise 4 Example">
</section>
<section>
<h2>Processes</h2>
<br>
<p>Whenever a command is executed, a new process is created.</p>
</section>
<section>
<h2>top</h2>
<br>
<p>The <code>top</code> command provides an up-to-date feed of information on the most active processes across the machine.</p>
<br>
<p>Useful for finding processes that are hogging the CPU.</p>
</section>
<section>
<h2>ps</h2>
<br>
<p>The <code>ps</code> utility displays all of your processes that have controlling terminals.</p>
</section>
<section>
<h2>ps</h2>
<img src="img/command-line-ps.png" alt="Command Line ps Processes">
</section>
<section>
<h2>Key Sequences</h2>
<br>
<p><code>Ctrl + Z</code>: Suspend the current process</p>
<br>
<p><code>Ctrl + C</code>: Terminate the current process</p>
</section>
<section>
<h2>Suspending a Process</h2>
<img src="img/command-line-suspend-process.png" alt="Command Line suspending a process">
</section>
<section>
<h2>bg & fg</h2>
<br>
<p>The <code>bg</code> and <code>fg</code> commands bring a suspended process back into a running state.</p>
<br>
<p><code>bg</code> runs it in a background process.</p>
<br>
<p><code>fg</code> runs it in the foreground of the current terminal.</p>
<br>
<p class="fragment">By default they target the most recently suspended process.</p>
<br>
<p class="fragment">The job number can be provided as an argument. (The number we saw when we suspended the process)</p>
</section>
<section>
<h2>Let's Develop It!</h2>
<br>
<ol>
<li>Run the <code>top</code> command.</li>
<li>Suspend the process.</li>
<li>Bring the process back into the foreground.</li>
</ol>
</section>
<section>
<h2>Let's Develop It!</h2>
<img src="img/exercise5-answer.png" alt="Exercise 5 Example">
</section>
<section>
<h2>kill</h2>
<br>
<p>The <code>kill</code> command terminates or sends a signal to a process.</p>
<br>
<p>It takes the process id (PID) as an argument.</p>
<br>
<p>You can find the PID using <code>top</code> or <code>ps</code>.</p>
</section>
<section>
<h2>Let's Develop It!</h2>
<br>
<ol>
<li>Clear your terminal and run the <code>yes</code> command.</li>
<li>Use the <code>Ctrl+Z</code> key sequence to suspend the process.</li>
<li>Use the <code>bg</code> command to send the process to the background.</li>
<li>Notice the output is still happening even though the process is running in the background.</li>
<li>Open a new terminal window, locate the PID for the "yes" process and use it to kill the process.</li>
</ol>
</section>
<section>
<h2>Commands</h2>
<br>
<p>Typing <code>!</code> followed by the name of a command will repeat the last line that began with that command.</p>
<br>
<ul>
<li><code>ls -la ~ | grep "Desktop"</code></li>
<li><code>!ls</code></li>
</ul>
<br><br>
<p>In both instances, you should get the same output because the second line is simply repeating the first.</p>
<br>
<p>Typing <code>!!</code> by itself will re-run the last line entered.</p>
</section>
<section>
<h2>history</h2>
<br>
<p>The terminal keeps an ongoing log of all the commands you've run.</p>
<br>
<p>The <code>history</code> command prints the contents of the history file.</p>
</section>
<section>
<h2>history</h2>
<img src="img/command-line-history.png" alt="Command Line history">
</section>
<section>
<h2>history</h2>
<br>
<p>You can run a previous command using the number in the history.</p>
<br>
<p><code>!12</code></p>
<br>
<p class="fragment">Almost no one does this.</p>
</section>
<section>
<h2>Keyboard Shortcuts</h2>
<br>
<p><code>Ctrl + a</code> moves the cursor to the beginning of the command.</p>
<br>
<p><code>Ctrl + e</code> moves the cursor to the end of the command.</p>
<br>
<p>Use the <code>tab</code> key to auto complete file paths</p>
<br>
<p>Use the <code>up</code> arrow to cycle through the command history.</p>
</section>
<section>
<h2>Let's Develop It!</h2>
<br>
<ol>
<li>Use your <code>up</code> and <code>down</code> arrows to locate a past command with one or more arguments.</li>
<li>Move your cursor to the beginning of the line.</li>
<li>Move your cursor to the end of the line.</li>
<li>Change one of the arguments and run it.</li>
<li>Run the <code>date</code> command.</li>
<li>Re-run the command from step 4 using <code>!</code>.</li>
<li>Time the execution of your original command by running <code>time !!</code>.</li>
</ol>
</section>
<section>
<h2>Real World Examples</h2>
<br>
<p>Here are some examples of using the command line to accomplish tasks relating to development.</p>
</section>
<section>
<h2>Serve up a Directory</h2>
<br>
<p><code>python -m simpleHTTPServer</code></p>
<br>
<p>Don't forget: you can <code>Ctrl + C</code> to exit.</p>
</section>
<section>
<h2>Version Control</h2>
<br>
<p>Initialize the current directory as a Git repository. <code>git init .</code></p>
<br>
<p>Commit your file changes. <code>git commit -m "Hello Git!"</code></p>
<br>
<p>Include all changes next time we commit. <code>git add --all</code></p>
<br>
<p>View the commit history. <code>git log</code></p>
<br>
<p>Check out <a href="https://git-scm.com/book/en/v2" target="_blank">Pro Git</a> for a crash course on command-line git.</p>
</section>
<section>
<h2>Watching a Log File</h2>
<br>
<p><code>tail -f my_awesome.log</code></p>
</section>
<section>
<h2>More Resources</h2>
<br>
<p>For those wanting to go deeper down the rabbit hole, check out these resources.</p>
<br>
<ul>
<li>
<a href="https://natelandau.com/my-mac-osx-bash_profile/" target="_blank">Nathaniel Landau: My Mac OSX Bash Profile</a>
</li>
<li>
<a href="http://code.tutsplus.com/tutorials/how-to-customize-the-command-prompt--net-20586" target="_blank">tuts+: How to Customize the Command Prompt</a>
</li>
<li>
<a href="http://www.tldp.org/LDP/abs/html/index.html" target="_blank">Advanced Bash Scripting Guide</a>
</li>
</ul>
</section>
<section>
<h2>Questions?</h2>
</section>
</div>
<footer>
<div class="copyright">
Intro to Command Line
<!-- -- Chapter name here (if content modified from original) -- -->
<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>
'[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>