2024-12-01 22:43:43 +02:00
#+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 ]]
2024-12-02 01:00:50 +02:00
*** timestamps
:PROPERTIES:
:CUSTOM_ID: timestamp
:END:
#+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 ]]
2024-12-01 22:43:43 +02:00
* 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=
2024-12-10 18:53:00 +02:00
** permissions
*** groups of three
- read
- write
- execute
*** directories
- read: are you allowed to see the files
- write: can you rename the files in the directory
- execute: "search" are you allowed to enter this directory
- to access a file in a directory, you need execute permissions on all directories in the path
** piping
- every program has two streams
- input stream
- output stream
- shell allows you to change streams
- angle brackets
- left angle < : rewire input
- right angle > : rewire output
- example
#+begin_src bash
echo hello > hello.txt
cat < hello.txt
#+end_src