diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/index.md b/2020/2020-02-15_gnuLinuxCourse/slides/index.md index e2c016f1754aec5462a6afeec3a09b8a1774ce51..54410d9da304fd7d8a7afa87f56761297e702d9a 100644 --- a/2020/2020-02-15_gnuLinuxCourse/slides/index.md +++ b/2020/2020-02-15_gnuLinuxCourse/slides/index.md @@ -1,6 +1,6 @@ -# Presentation Title +# Introduction to GNU/Linux (Shell) -## Month XYth, 2019 +## 26 March 2020 <div style="top: 6em; left: 0%; position: absolute;"> <img src="theme/img/lcsb_bg.png"> diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/intro_aim.md b/2020/2020-02-15_gnuLinuxCourse/slides/intro_aim.md index 992e314d5ce66bafe37c64c3f027a49031b24c6e..7a24347ffa13ebff6e98456051528a8dab2d5bc2 100644 --- a/2020/2020-02-15_gnuLinuxCourse/slides/intro_aim.md +++ b/2020/2020-02-15_gnuLinuxCourse/slides/intro_aim.md @@ -1,33 +1,13 @@ # Aims of the Tutorial - -* Connect to a GNU/Linux server - + SSH, a de-facto standard for secure communication - - <!-- .element: class="fragment" --> - + For Windows users - - [MobaXterm][1] (_recommended by R3_) - - [PuTTY][2], simple, ugly, but efficient and open source and does only SSH +* Gain Familiarity With the Unix Shell + - And hint at ways it can be harnessed to give great power to the + user - <!-- .element: class="fragment" --> - + For Mac and GNU/Linux users, OpenSSH command line client - - <!-- .element: class="fragment" --> - <!-- .element: class="fragment" --> -* Explore how to use the shell effectively - * We will use bash which is (almost) universaly present - - Steve Jobs did not like the license, but ... - ```shell - brew install bash - ``` - - <!-- .element: class="fragment" --> - - <!-- .element: class="fragment" --> - +* Connect to a GNU/Linux server + + Using SSH, a de-facto standard for secure communication + <!-- .element: class="fragment" --> - -[1]: https://mobaxterm.mobatek.net/download-home-edition.html -[2]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html +<!-- <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/A-HIlNGczgU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> --> diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/intro_beforewebegin.md b/2020/2020-02-15_gnuLinuxCourse/slides/intro_beforewebegin.md index e8c3dc090c39e55efb1bf20e53cd4ce6412a34e7..112a8b8f296de1eb6e5a083ef222341a1fbdcfa0 100644 --- a/2020/2020-02-15_gnuLinuxCourse/slides/intro_beforewebegin.md +++ b/2020/2020-02-15_gnuLinuxCourse/slides/intro_beforewebegin.md @@ -1,4 +1,4 @@ -# Before We Begin ... +# Or, the Beginning of One? * Learning GNU/Linux has never been easier! + An explosion of [resources for self-study][1] @@ -18,7 +18,7 @@ <!-- .element: class="fragment" --> -[1]: https://git-r3lab.uni.lu/R3/school/courses/blob/gnu-linux/2020/2020-02-15_gnuLinuxCourse/resources.md +[1]: https://git-r3lab.uni.lu/R3/school/courses/blob/develop/2020/2020-02-15_gnuLinuxCourse/resources.md [2]: https://duckduckgo.com [3]: https://unix.stackexchange.com/ [4]: https://www.reddit.com/r/linux/ diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/intro_first.md b/2020/2020-02-15_gnuLinuxCourse/slides/intro_first.md index 51fc2d7c19db2d51788e9de2555b561dc242df91..0865c661f5f44d9008c2035c8c9d86bba61f43cc 100644 --- a/2020/2020-02-15_gnuLinuxCourse/slides/intro_first.md +++ b/2020/2020-02-15_gnuLinuxCourse/slides/intro_first.md @@ -11,7 +11,8 @@ <!-- .element: class="fragment" --> + GNU/Linux user since [Debian Woody][5] (ca 2002) - + Arrived as a seven CD set from a small computer shop from the [Getting Debian][6] + + Arrived as a seven CD set from a small computer shop from the + list of international vendors at [Getting Debian][6] <!-- .element: class="fragment" --> diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/last.md b/2020/2020-02-15_gnuLinuxCourse/slides/last.md new file mode 100644 index 0000000000000000000000000000000000000000..47ec8cf89f9fe8b3ac213423442751add7b05fab --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/last.md @@ -0,0 +1,3 @@ +# The End + +* Thanks for your attention! diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/list.json b/2020/2020-02-15_gnuLinuxCourse/slides/list.json index 294a1356765da975c2a80cd7c7c207463173ca53..88db4375102bacf3e78a2714efc67109939ecf88 100644 --- a/2020/2020-02-15_gnuLinuxCourse/slides/list.json +++ b/2020/2020-02-15_gnuLinuxCourse/slides/list.json @@ -1,8 +1,18 @@ [ { "filename" : "index.md" }, { "filename" : "intro_first.md"}, + { "filename" : "the-end.md"}, { "filename" : "intro_beforewebegin.md"}, { "filename" : "intro_aim.md"}, + { "filename" : "shell.md"}, + { "filename" : "shell/start.md"}, + { "filename" : "shell/file-explorer-basic.md"}, + { "filename" : "shell/file-explorer-basic-concepts.md"}, + { "filename" : "shell/effective-cmd-editing.md"}, + { "filename" : "shell/effective-cmd-editing-concepts.md"}, + { "filename" : "shell/cp-mv.md"}, + { "filename" : "shell/rm.md"}, + { "filename" : "shell/cp-mv-rm-concepts.md"}, { "filename" : "ssh_intro.md"}, { "filename" : "ssh_intro_2.md"}, { "filename" : "ssh_intro_3.md"}, @@ -16,5 +26,6 @@ { "filename" : "ex_ssh_win/ssh_keygen.md"}, { "filename" : "ex_ssh_lin/intro.md"}, { "filename" : "ex_ssh_lin/session_shell.md"}, - { "filename" : "ex_ssh_lin/session_shell_2.md"} + { "filename" : "ex_ssh_lin/session_shell_2.md"}, + { "filename" : "last.md"} ] diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell.md new file mode 100644 index 0000000000000000000000000000000000000000..3ca1780838213739bc7ffba0501774cd58f5b7ad --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell.md @@ -0,0 +1,62 @@ +# The Barrier between the Human and the Machine +<div class="multicol"> + +<div class="col" data-markdown> + +* What is a shell? + - Omnipresent user interface + + <!-- .element: class="fragment" --> + - It interprets commands given by the user + + <!-- .element: class="fragment" --> + - It is heavily keyboard based + + <!-- .element: class="fragment" --> + +<!-- .element: class="fragment" --> + +* Shell runs within a terminal application + - In ancient times, these were actual pieces of hardware + + <!-- .element: class="fragment" --> + - Today, a program that echoes user input and displays command results + + <!-- .element: class="fragment" --> + +<!-- .element: class="fragment" --> + +* How to access it? + - **GNU/Linux systems:** + - Depends on the desktop interface (of which there are many) + - Access from a `Start`-like menu, or a `Win`-key search as + *terminal*, or *console* + - if all else fails, `Ctrl` + `Alt` + `F[2-6]` + + <!-- .element: class="fragment" --> + - **Windows:** [MobaXterm][1] which you hopefully installed + + <!-- .element: class="fragment" --> + - **Mac:** Built-in terminal; *Spotlight* search for *terminal* + + <!-- .element: class="fragment" --> + +<!-- .element: class="fragment" --> + +</div> + +<div class="col" data-markdown> + +<img src="variae/figs/shell/3270.jpg" width="90%" /> + +<!-- .element: class="fragment" --> + +</div> + +</div> + + +[terminal]: variae/figs/shell/3270.jpg "IBM 3270" + +[1]: https://mobaxterm.mobatek.net/download-home-edition.html + diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell/cp-mv-rm-concepts.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell/cp-mv-rm-concepts.md new file mode 100644 index 0000000000000000000000000000000000000000..198dbdf6b41a775204bcfaa004aabe75e02a3bb2 --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell/cp-mv-rm-concepts.md @@ -0,0 +1,20 @@ +# File Explorer: Copy(cp), Move(mv) and Remove(rm) (Concepts) + +* cp, mv and rm can act on either files, or directories + ```shell + cp file1 file2 + mv file1 file2 + + cp -R dir1 new/location + mv dir1 new/location + + cp file1 file2 ... some/existing/dir + mv file1 file2 ... some/existing/dir + + rm file1 ... + rm -R dir + rm -Rf dir # Danger! + ``` + +* Effectiveness of these commands greatly improved by file patterns + - *, ., [0-9],[ABC], {}, etc diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell/cp-mv.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell/cp-mv.md new file mode 100644 index 0000000000000000000000000000000000000000..3c4cc1275dc5af7a7c55259d49c7170525646eaa --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell/cp-mv.md @@ -0,0 +1,16 @@ +# File Explorer: Copy(cp), Move(mv) and Remove(rm) File Operations + +```console +$ mkdir linux-practical-03 +$ cp linux-practical-01/pr1-hello-world.txt linux-practical-03/pr3-hello-world.txt # cp arg1 arg2: copy file arg1 to file arg2 +$ mkdir linux-practical-03/dump +$ cp -R linux-practical-01 linux-practical-03/dump # Copy the entire content of linux-practical-01 +$ # to dump subdirectory of linux-practical-03 +$ ls linux-practical-03/dump # Check if linux-practical-01 is there. +$ # Move one up in history, jump to the beginning of the line ('Ctrl'+'A'), then +$ # replace 'ls' with 'mv' +$ # From then on ... +$ mv linux-practical-03/dump linux-practical-03/dump2 # Congratulations, you just renamed dump to dump2. +$ ls linux-practical-03 # Check the content. The directory dump should not exist. + +``` diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell/effective-cmd-editing-concepts.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell/effective-cmd-editing-concepts.md new file mode 100644 index 0000000000000000000000000000000000000000..7cf129fa239fe45f00269da04539f0df6fa5b223 --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell/effective-cmd-editing-concepts.md @@ -0,0 +1,15 @@ +# File Explorer: Effective Command Line Editing (Concepts) + +* Moving using arrow keys is tedious + +* Retyping commands that contain a typo is even more tedious + +* *Readline* facility of the bash shell offers quicker navigation + - Move by a word left and right using `Ctrl`+`Left`, or `Right` + - Move to a beginning, or the end of the line using `Ctrl`+`A` and `Ctrl`+`E` + - Delete an entire word using `Alt`+`D` + - Paste a deleted word with `Ctrl`+`Y` + +* Reuse previous commands! + - The shell remembers what you type + - Move to a previous line in history using `Up` and `Down` arrows diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell/effective-cmd-editing.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell/effective-cmd-editing.md new file mode 100644 index 0000000000000000000000000000000000000000..b4734d3ac9d236f5b94bafa757b6de1db2302ee0 --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell/effective-cmd-editing.md @@ -0,0 +1,25 @@ +# File Explorer: Effective Command Line Editing + +```console +$ # Move up the history list until 'mkdir linux-practical-01'. +$ # Move cursor using word motions 'Ctrl' + 'Left', or +$ # 'Ctrl' + 'Right' around the command to get the feel for word motions. +$ # Move cursor using begin ('Ctrl' + 'A') and end ('Ctrl' + 'E') +$ # motions to the beginning and the end of the line. +$ mkdir linux-practical-02 # Based on the previous command + motions. +$ cd lin # TAB to complete, then TAB two times to list possible endings. +$ cd linux-practical-02 # Based on the previous completion. +$ # Move up the history list to mkdir subdir-01 +$ mkdir subdir-02 +$ # Move up the history to the touch subdir-01/a ... command. +$ # Replace 1 with 2 using 'Ctrl' + 'A' and word motions. +$ touch subdir-02/a subdir-02/b subdir-02/c +$ history 10 # Lists last ten commands. +$ cd +``` +<!-- * Motions --> +<!-- - `Left` and `Right` arrow move one character left, or right --> +<!-- - `Ctrl` + `Left`, or `Right` move left, or right for one word --> +<!-- - `Ctrl` + `A`, or `E` move to the beginning, or the end of the line --> +<!-- - `Up` and `Down` move through history entries --> +<!-- - `TAB` completes --> diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell/file-explorer-basic-concepts.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell/file-explorer-basic-concepts.md new file mode 100644 index 0000000000000000000000000000000000000000..7723a20d4d2d9ddd28218e1630e817fa3b09894f --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell/file-explorer-basic-concepts.md @@ -0,0 +1,14 @@ +# File Explorer: Basics (Concepts) + +* While interacting with a shell, we are always in a given *working directory* +* Data is organised into directories and files, like on other systems. +* Location of a file in respect to the current directory is given by a (*relative*) file path + - some/dir/with/a/file + +* New commands: + - `pwd` : outputs the current working directory + - `ls [-lhd ... file1 file2 file3 ...]` : lists files + - `cd path/to/existing/dir` : change current directory to a new directory + - `mkdir [-p] path/to/new/dir` : creates a new directory + - `touch file1 [file2 file3 ...]` : creates an empty file. + - `history` : view the list of commands executed so far diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell/file-explorer-basic.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell/file-explorer-basic.md new file mode 100644 index 0000000000000000000000000000000000000000..24154e32e2fa7d0fbb2603774401c6f148d96010 --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell/file-explorer-basic.md @@ -0,0 +1,21 @@ +# File Explorer: Basics +```console +$ pwd # Displays the absolute path to the current dirrectory. +$ ls # List contents of the current directory. +$ mkdir linux-practical-01 # Create a new directory. +$ cd linux-practical-01 # Switch to a different directory. +$ touch pr1-hello-world.txt # Create a new and empty file. +$ mkdir subdir-01 # Create another directory. +$ touch subdir-01/a subdir-01/b subdir-01/c # Create multiple empty files. +$ ls subdir-01 # List contents of directory. +$ mkdir -p subdir-02/dir-X/dir-Y/dir-Z # Create a nested directory under the path. +$ ls subdir-02/dir-X # Confirm the directory dir-Y has been created. +$ history # Lists the commands executed so far. +$ cd +``` + +<!-- * Concepts --> +<!-- - Files and directories --> +<!-- - Paths --> +<!-- - Importance of quoting --> +<!-- - History --> diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell/rm.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell/rm.md new file mode 100644 index 0000000000000000000000000000000000000000..348794912ce36a429fc8e5c8b116a220f07e3f82 --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell/rm.md @@ -0,0 +1,15 @@ +# File Explorer: Copy(cp), Move(mv) and Remove(rm) File Operations + +* Removing files and directories. + +```console +$ rm linux-practical-03/pr3-hello-world.txt # Deletes the file. +$ # History, one up then adapt the command into +$ cd linux-practical-03 +$ ls # Check if it is indeed deleted. +$ rm -R dump2 # Recursively remove directory dump2 and all of its contents. +$ history 10 # Just to remind yourself what you did in last ten steps. +$ cd + +``` + diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/shell/start.md b/2020/2020-02-15_gnuLinuxCourse/slides/shell/start.md new file mode 100644 index 0000000000000000000000000000000000000000..e36cb9d2453e0a418a663e152d4b499a6c678ad0 --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/shell/start.md @@ -0,0 +1,16 @@ +# Command Line + + +* **Command prompt:** Non-editable; May provide contextual information +* **Command area:** Typed commands are shown here +* **RETURN or ENTER:** Pressing this key will execute the command + +* General form of the commands + ```shell + prompt$ ls + prompt$ ls -a + prompt$ ls --help + prompt$ rsync -avz /path/to/file/a /path/to/file/b + prompt$ make -j8 + prompt$ gfortran -c -mtune=native + ``` diff --git a/2020/2020-02-15_gnuLinuxCourse/slides/the-end.md b/2020/2020-02-15_gnuLinuxCourse/slides/the-end.md new file mode 100644 index 0000000000000000000000000000000000000000..dfa2ee28dd1ccb29974f19fd753a49fabae15cac --- /dev/null +++ b/2020/2020-02-15_gnuLinuxCourse/slides/the-end.md @@ -0,0 +1,3 @@ +# The End of an Era? + +<iframe width="100%" height="800" src="https://www.youtube.com/embed/A-HIlNGczgU?start=127" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> diff --git a/2020/2020-02-15_gnuLinuxCourse/variae/figs/shell/3270.jpg b/2020/2020-02-15_gnuLinuxCourse/variae/figs/shell/3270.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7a8db9b174d32ce8e5da3249606964507a08c006 Binary files /dev/null and b/2020/2020-02-15_gnuLinuxCourse/variae/figs/shell/3270.jpg differ