started lec 1 and lec 2 notes
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 494 KiB |
|
Before Width: | Height: | Size: 392 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 233 KiB |
|
Before Width: | Height: | Size: 277 KiB |
|
Before Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 383 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 74 KiB |
BIN
_share/media/img/lecture01/ex01.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 324 KiB |
105
_subsections/lesson-01.org
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
#+title: Lesson 01 | Course Overview + Shell
|
||||||
|
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../_share/media/css/missing-semester.css" />
|
||||||
|
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../_share/media/css/org-media-sass/collapsible.css" />
|
||||||
|
#+HTML_HEAD: <script src="../_share/media/js/collapsible.js"></script>
|
||||||
|
|
||||||
|
* Links
|
||||||
|
#+attr_html: :class links
|
||||||
|
- [[../toc.org][TOC | Missing Semester]]
|
||||||
|
- [[https://www.youtube.com/playlist?list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J][Playlist: Missing Semester]]
|
||||||
|
- current: https://youtu.be/Z56Jmr9Z34Q?si=t9wQkGXDznscDtNH&t=1217
|
||||||
|
|
||||||
|
* Notes
|
||||||
|
** why
|
||||||
|
- there are many tools that make life easier for programmers
|
||||||
|
- lecture notes and recordings are available online
|
||||||
|
|
||||||
|
** the shell
|
||||||
|
- programs are meant to be integrates with each other through the shell
|
||||||
|
- most common shell is Bourne Again Shell (bash)
|
||||||
|
|
||||||
|
** shell prompt
|
||||||
|
- typical shell prompt:
|
||||||
|
#+attr_html: :width 300px
|
||||||
|
file:../_share/media/img/lecture01/ex01.png
|
||||||
|
|
||||||
|
- shells can be customized extensibly
|
||||||
|
- arguments are seperated by whitespace
|
||||||
|
- multiple words can be passed as a single argument via:
|
||||||
|
- quotes
|
||||||
|
#+begin_src bash
|
||||||
|
echo "Hello world"
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
- escapes
|
||||||
|
#+begin_src bash
|
||||||
|
echo Hello\ world
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** how does the shell know where programs are
|
||||||
|
- via environment variable
|
||||||
|
- things that are set whenever you start your shell
|
||||||
|
- where is your home directory
|
||||||
|
- what is your username
|
||||||
|
- what are the PATHs to your programs
|
||||||
|
- shells, and bash in particular, are programming languages
|
||||||
|
|
||||||
|
** paths
|
||||||
|
*** PATH environment variable
|
||||||
|
|
||||||
|
- a list seperated by colons (:)
|
||||||
|
- when bash is asked to run a program bash will search through the directories in path until it finds the program
|
||||||
|
|
||||||
|
*** absolute vs relative path
|
||||||
|
|
||||||
|
- pwd: print working directory
|
||||||
|
- all relative paths are relative to your current working directory
|
||||||
|
- absolute path starts with '/'
|
||||||
|
|
||||||
|
*** special directories
|
||||||
|
- '.' current directory
|
||||||
|
- '..' parent directory
|
||||||
|
|
||||||
|
*** tilde (~)
|
||||||
|
- always expands to your home directory
|
||||||
|
|
||||||
|
*** dash (-)
|
||||||
|
- toggles to the previous directory you were at
|
||||||
|
|
||||||
|
#+begin_src bash
|
||||||
|
cd /home/ronny/programs/notes/courses
|
||||||
|
cd ../../
|
||||||
|
cd -
|
||||||
|
pwd
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
the output will be
|
||||||
|
=/home/ronny/programs/notes/courses=
|
||||||
|
|
||||||
|
|
||||||
|
*** Playlist
|
||||||
|
|
||||||
|
#+attr_html: :class playlist
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=20s][00:20 why we're doing this class]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=251s][04:11 the shell]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=338s][05:38 install a terminal and a shell]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=364s][06:05 the shell prompt]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=411s][06:51 shell prompt]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=522s][08:42 how does the shell know what these programs are]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=672s][11:12 paths]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=738s][12:18 absolute path]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=759s][12:39 relative paths]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=1034s][17:14 tilde character]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=1336s][22:16 directories]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=1376s][22:56 execute on directories]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=1514s][25:14 cp command]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=1547s][25:47 rm]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=1590s][26:30 create a new directory]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=1912s][31:52 pipe character]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=2044s][34:04 grep]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=2145s][35:45 the root user]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=2239s][37:19 kernel paramters]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=2612s][43:32 scroll lock led]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=2706s][45:06 open a file]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=2829s][47:09 lecture notes]]
|
||||||
|
- [[https://www.youtube.com/watch?v=Z56Jmr9Z34Q&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J&t=2875s][office hours]]
|
||||||
|
|
@ -10,6 +10,48 @@
|
||||||
|
|
||||||
* Notes
|
* Notes
|
||||||
|
|
||||||
|
** bash
|
||||||
|
*** spaces are critical with bash
|
||||||
|
- this works:
|
||||||
|
#+begin_src bash
|
||||||
|
foo=bar
|
||||||
|
echo $foo
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
- this doesn't:
|
||||||
|
|
||||||
|
#+begin_src bash
|
||||||
|
foo = bar
|
||||||
|
echo $foo
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
the output of that will be
|
||||||
|
=zsh: command not found: foo=
|
||||||
|
|
||||||
|
- what happens in the above example is that we are effectively calling the "foo" program with the arguments: "=" and "bar"
|
||||||
|
|
||||||
|
*** quotes
|
||||||
|
- you can use double or single quotes to print a value
|
||||||
|
#+begin_src bash
|
||||||
|
echo "Hello"
|
||||||
|
#+end_src
|
||||||
|
#+begin_src bash
|
||||||
|
echo 'Hello'
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
- double quotes can interpolate variables
|
||||||
|
#+begin_src bash
|
||||||
|
echo "Value is $foo"
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
will return: =Value is bar=
|
||||||
|
|
||||||
|
- single quotes can NOT interpoloate variables
|
||||||
|
#+begin_src bash
|
||||||
|
echo 'Value is $foo'
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
will return: =Value is $foo=
|
||||||
|
|
||||||
*** Playlist
|
*** Playlist
|
||||||
|
|
||||||
|
|
|
||||||
4
toc.org
|
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
* Contents Overview
|
* Contents Overview
|
||||||
#+attr_html: :class contents-overview
|
#+attr_html: :class contents-overview
|
||||||
- [[./_subsections/lesson-02.org][Lesson 01 | Course Overview + The Shell]]
|
- [[./_subsections/lesson-01.org][Lesson 01 | Course Overview + The Shell]]
|
||||||
- [[./_subsections/lesson-03.org][Lesson 02 | Shell Tools and Scripting]]
|
- [[./_subsections/lesson-02.org][Lesson 02 | Shell Tools and Scripting]]
|
||||||
|
|
||||||
*** Playlist
|
*** Playlist
|
||||||
|
|
||||||
|
|
|
||||||