diff --git a/.gitignore b/.gitignore index 0efccc7..966373d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ /web_src/**/*_files /web_src/**/*_cache /.luarc.json -*.log \ No newline at end of file +/sandbox +*.log diff --git a/jupyterhub_volumes/course/unix.ipynb b/jupyterhub_volumes/course/unix.ipynb deleted file mode 100644 index 2f60fa3..0000000 --- a/jupyterhub_volumes/course/unix.ipynb +++ /dev/null @@ -1,897 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "30438c30", - "metadata": {}, - "source": [ - "# Unix Essentials — Bash Practice Notebook\n", - "\n", - "This notebook contains 50 small Bash exercises grouped by topic.\n", - "Each exercise includes a hidden solution that can be revealed in Jupyter." - ] - }, - { - "cell_type": "markdown", - "id": "39d711f9", - "metadata": {}, - "source": [ - "## Series 1 — Paths and Directories" - ] - }, - { - "cell_type": "markdown", - "id": "6fb7335e", - "metadata": {}, - "source": [ - "### Exercise 1.1 — Show your current working directory" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2b8575f3", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "pwd" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "21f63bb0", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "pwd" - ] - }, - { - "cell_type": "markdown", - "id": "61a624bf", - "metadata": {}, - "source": [ - "### Exercise 1.2 — Create a new directory named `testdir`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4a4df387", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "mkdir testdir" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2b5cfbca", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "mkdir testdir" - ] - }, - { - "cell_type": "markdown", - "id": "2dccbb61", - "metadata": {}, - "source": [ - "### Exercise 1.3 — Move into `testdir` using a relative path" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fb73ca3c", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "cd testdir" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ba670a20", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "cd testdir" - ] - }, - { - "cell_type": "markdown", - "id": "4f7e5817", - "metadata": {}, - "source": [ - "### Exercise 1.4 — Create two subdirectories `a` and `b` in one command" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "30be8f44", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "mkdir a b" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "caf92714", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "mkdir a b" - ] - }, - { - "cell_type": "markdown", - "id": "edec9041", - "metadata": {}, - "source": [ - "### Exercise 1.5 — Return to the parent directory using `..`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "32a0f1df", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "cd .." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2a0aa92f", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "cd .." - ] - }, - { - "cell_type": "markdown", - "id": "31917159", - "metadata": {}, - "source": [ - "### Exercise 1.6 — Create nested directories `one/two/three` in a single command" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c0a313c3", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "mkdir -p one/two/three" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4af63dce", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "mkdir -p one/two/three" - ] - }, - { - "cell_type": "markdown", - "id": "24ee949e", - "metadata": {}, - "source": [ - "### Exercise 1.7 — List the absolute path of the current directory" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8258fff7", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "pwd" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a6a062b2", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "pwd" - ] - }, - { - "cell_type": "markdown", - "id": "6d724d3e", - "metadata": {}, - "source": [ - "### Exercise 1.8 — Create a directory using an absolute path" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5f497f7c", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "mkdir /tmp/mydir" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1d1d4e27", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "mkdir /tmp/mydir" - ] - }, - { - "cell_type": "markdown", - "id": "0a4cbe5b", - "metadata": {}, - "source": [ - "### Exercise 1.9 — Display both `.` and `..` directories with `ls -a`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7d962a9f", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "ls -a" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "91994de2", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "ls -a" - ] - }, - { - "cell_type": "markdown", - "id": "e147ff34", - "metadata": {}, - "source": [ - "### Exercise 1.10 — Remove the directory `/tmp/mydir`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "dcae28e3", - "metadata": {}, - "outputs": [], - "source": [ - "# your work here\n", - "rmdir /tmp/mydir" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1a000f14", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "rmdir /tmp/mydir" - ] - }, - { - "cell_type": "markdown", - "id": "578548f7", - "metadata": {}, - "source": [ - "## Series 2 — File Manipulation" - ] - }, - { - "cell_type": "markdown", - "id": "813140d5", - "metadata": {}, - "source": [ - "### Exercise 2.1 — Create an empty file named `notes.txt`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "08385872", - "metadata": {}, - "outputs": [], - "source": [ - "touch notes.txt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a474ad37", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "touch notes.txt" - ] - }, - { - "cell_type": "markdown", - "id": "6e918f3d", - "metadata": {}, - "source": [ - "### Exercise 2.2 — Copy `notes.txt` to `backup.txt`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "faf85985", - "metadata": {}, - "outputs": [], - "source": [ - "cp notes.txt backup.txt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4d3e54d5", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "cp notes.txt backup.txt" - ] - }, - { - "cell_type": "markdown", - "id": "2c924f2e", - "metadata": {}, - "source": [ - "### Exercise 2.3 — Rename `backup.txt` to `archive.txt`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2d4adeb4", - "metadata": {}, - "outputs": [], - "source": [ - "mv backup.txt archive.txt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2c62e70f", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "mv backup.txt archive.txt" - ] - }, - { - "cell_type": "markdown", - "id": "c9e525a7", - "metadata": {}, - "source": [ - "### Exercise 2.4 — Create 3 files and remove one with `rm`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3ef53a3a", - "metadata": {}, - "outputs": [], - "source": [ - "touch a.txt b.txt c.txt\n", - "rm b.txt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "55e07074", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "touch a.txt b.txt c.txt\n", - "rm b.txt" - ] - }, - { - "cell_type": "markdown", - "id": "b5a406b4", - "metadata": {}, - "source": [ - "### Exercise 2.5 — Remove a directory recursively" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2c819a49", - "metadata": {}, - "outputs": [], - "source": [ - "mkdir -p tmpdir/sub\n", - "rm -rf tmpdir" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b958a668", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "mkdir -p tmpdir/sub\n", - "rm -rf tmpdir" - ] - }, - { - "cell_type": "markdown", - "id": "9aa4996e", - "metadata": {}, - "source": [ - "## Series 3 — Redirections and Pipes" - ] - }, - { - "cell_type": "markdown", - "id": "ada90797", - "metadata": {}, - "source": [ - "### Exercise 3.1 — Save the output of `ls` to a file `list.txt`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "25afa75b", - "metadata": {}, - "outputs": [], - "source": [ - "ls > list.txt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "80ca4767", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "ls > list.txt" - ] - }, - { - "cell_type": "markdown", - "id": "61c3bff6", - "metadata": {}, - "source": [ - "### Exercise 3.2 — Append the date to `list.txt`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b7849f15", - "metadata": {}, - "outputs": [], - "source": [ - "date >> list.txt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "83b08fe6", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "date >> list.txt" - ] - }, - { - "cell_type": "markdown", - "id": "600edcaa", - "metadata": {}, - "source": [ - "### Exercise 3.3 — Count lines of `list.txt` with a pipe" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "37e859f4", - "metadata": {}, - "outputs": [], - "source": [ - "cat list.txt | wc -l" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d1429a1c", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "cat list.txt | wc -l" - ] - }, - { - "cell_type": "markdown", - "id": "a901cf34", - "metadata": {}, - "source": [ - "### Exercise 3.4 — Redirect error messages to a file" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f2c1d530", - "metadata": {}, - "outputs": [], - "source": [ - "ls /fakepath 2> errors.txt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "66c68bc4", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "ls /fakepath 2> errors.txt" - ] - }, - { - "cell_type": "markdown", - "id": "72e5eca4", - "metadata": {}, - "source": [ - "## Series 4 — Viewing Results" - ] - }, - { - "cell_type": "markdown", - "id": "dd7cbf2e", - "metadata": {}, - "source": [ - "### Exercise 4.1 — Display the first 5 lines of `/etc/passwd`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "195c0f25", - "metadata": {}, - "outputs": [], - "source": [ - "head -5 /etc/passwd" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "72dc0297", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "head -5 /etc/passwd" - ] - }, - { - "cell_type": "markdown", - "id": "227ebdf8", - "metadata": {}, - "source": [ - "### Exercise 4.2 — Show the last 3 lines of `/etc/passwd`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3a829074", - "metadata": {}, - "outputs": [], - "source": [ - "tail -3 /etc/passwd" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e66f1752", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "tail -3 /etc/passwd" - ] - }, - { - "cell_type": "markdown", - "id": "826cbb41", - "metadata": {}, - "source": [ - "### Exercise 4.3 — Use `grep` to show lines containing 'root'" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "df9a877b", - "metadata": {}, - "outputs": [], - "source": [ - "grep root /etc/passwd" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5ed43d3d", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "grep root /etc/passwd" - ] - }, - { - "cell_type": "markdown", - "id": "a6c2f0a8", - "metadata": {}, - "source": [ - "## Series 5 — Process Management" - ] - }, - { - "cell_type": "markdown", - "id": "333ab7c1", - "metadata": {}, - "source": [ - "### Exercise 5.1 — List current processes" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "41dc9dfb", - "metadata": {}, - "outputs": [], - "source": [ - "ps" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c0f28455", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "ps" - ] - }, - { - "cell_type": "markdown", - "id": "c2d37e8f", - "metadata": {}, - "source": [ - "### Exercise 5.2 — Display dynamic process list with `top`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7931c9aa", - "metadata": {}, - "outputs": [], - "source": [ - "top" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "947570cf", - "metadata": { - "jupyter": { - "outputs_hidden": true, - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n", - "top" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Bash", - "language": "bash", - "name": "bash" - }, - "language_info": { - "name": "bash" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/jupyterhub_volumes/course/unix_exercises_bash.ipynb b/jupyterhub_volumes/course/unix_exercises_bash.ipynb index 7784d09..b67dd48 100644 --- a/jupyterhub_volumes/course/unix_exercises_bash.ipynb +++ b/jupyterhub_volumes/course/unix_exercises_bash.ipynb @@ -4,7 +4,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Unix Essentials \u2014 Bash Practice Notebook\n\n", + "# Unix Essentials — Bash Practice Notebook\n", + "\n", "This notebook contains 50 short exercises grouped in 5 series.\n", "Each exercise has a hidden solution for self-assessment." ] @@ -13,14 +14,16 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Series 1 \u2013 Path Manipulation\n\nFocus: `pwd`, `cd`, `mkdir`, `.`, `..`, relative and absolute paths." + "## Series 1 – Path Manipulation\n", + "\n", + "Focus: `pwd`, `cd`, `mkdir`, `.`, `..`, relative and absolute paths." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.1 \u2013 Show current directory" + "### Exercise 1.1 – Show current directory" ] }, { @@ -37,20 +40,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\npwd" + "# Solution\n", + "pwd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.2 \u2013 Create a directory named `work`" + "### Exercise 1.2 – Create a directory named `work`" ] }, { @@ -67,20 +71,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nmkdir work" + "# Solution\n", + "mkdir work" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.3 \u2013 Change to the `work` directory" + "### Exercise 1.3 – Change to the `work` directory" ] }, { @@ -97,20 +102,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncd work" + "# Solution\n", + "cd work" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.4 \u2013 Create two subdirectories `data` and `logs`" + "### Exercise 1.4 – Create two subdirectories `data` and `logs`" ] }, { @@ -127,20 +133,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nmkdir data logs" + "# Solution\n", + "mkdir data logs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.5 \u2013 Move back to the parent directory" + "### Exercise 1.5 – Move back to the parent directory" ] }, { @@ -157,20 +164,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncd .." + "# Solution\n", + "cd .." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.6 \u2013 Create nested directories `project/src` in one command" + "### Exercise 1.6 – Create nested directories `project/src` in one command" ] }, { @@ -187,20 +195,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nmkdir -p project/src" + "# Solution\n", + "mkdir -p project/src" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.7 \u2013 Display the absolute path" + "### Exercise 1.7 – Display the absolute path" ] }, { @@ -217,20 +226,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\npwd" + "# Solution\n", + "pwd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.8 \u2013 List all including hidden ones" + "### Exercise 1.8 – List all including hidden ones" ] }, { @@ -247,20 +257,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nls -a" + "# Solution\n", + "ls -a" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.9 \u2013 Create directory using absolute path `/tmp/test1`" + "### Exercise 1.9 – Create directory using absolute path `/tmp/test1`" ] }, { @@ -277,20 +288,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nmkdir /tmp/test1" + "# Solution\n", + "mkdir /tmp/test1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 1.10 \u2013 Remove directory `/tmp/test1`" + "### Exercise 1.10 – Remove directory `/tmp/test1`" ] }, { @@ -307,27 +319,30 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nrmdir /tmp/test1" + "# Solution\n", + "rmdir /tmp/test1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Series 2 \u2013 File Manipulation\n\nFocus: `rm`, `rm -rf`, `rmdir`, `cp`, `mv`." + "## Series 2 – File Manipulation\n", + "\n", + "Focus: `rm`, `rm -rf`, `rmdir`, `cp`, `mv`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.1 \u2013 Create an empty file `a.txt`" + "### Exercise 2.1 – Create an empty file `a.txt`" ] }, { @@ -344,20 +359,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ntouch a.txt" + "# Solution\n", + "touch a.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.2 \u2013 Copy `a.txt` to `b.txt`" + "### Exercise 2.2 – Copy `a.txt` to `b.txt`" ] }, { @@ -374,20 +390,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncp a.txt b.txt" + "# Solution\n", + "cp a.txt b.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.3 \u2013 Rename `b.txt` to `c.txt`" + "### Exercise 2.3 – Rename `b.txt` to `c.txt`" ] }, { @@ -404,20 +421,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nmv b.txt c.txt" + "# Solution\n", + "mv b.txt c.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.4 \u2013 Move `c.txt` to `/tmp/`" + "### Exercise 2.4 – Move `c.txt` to `/tmp/`" ] }, { @@ -434,20 +452,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nmv c.txt /tmp/" + "# Solution\n", + "mv c.txt /tmp/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.5 \u2013 Create a folder `tempdir`" + "### Exercise 2.5 – Create a folder `tempdir`" ] }, { @@ -464,20 +483,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nmkdir tempdir" + "# Solution\n", + "mkdir tempdir" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.6 \u2013 Create files `x.txt`, `y.txt` in it" + "### Exercise 2.6 – Create files `x.txt`, `y.txt` in it" ] }, { @@ -494,20 +514,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ntouch tempdir/x.txt tempdir/y.txt" + "# Solution\n", + "touch tempdir/x.txt tempdir/y.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.7 \u2013 Remove `y.txt`" + "### Exercise 2.7 – Remove `y.txt`" ] }, { @@ -524,20 +545,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nrm tempdir/y.txt" + "# Solution\n", + "rm tempdir/y.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.8 \u2013 Remove non-empty folder `tempdir` recursively" + "### Exercise 2.8 – Remove non-empty folder `tempdir` recursively" ] }, { @@ -554,20 +576,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nrm -rf tempdir" + "# Solution\n", + "rm -rf tempdir" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.9 \u2013 Create and remove empty folder `delete_me`" + "### Exercise 2.9 – Create and remove empty folder `delete_me`" ] }, { @@ -584,20 +607,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nmkdir delete_me && rmdir delete_me" + "# Solution\n", + "mkdir delete_me && rmdir delete_me" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 2.10 \u2013 Create file with text using echo" + "### Exercise 2.10 – Create file with text using echo" ] }, { @@ -614,27 +638,30 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\necho 'hello world' > greeting.txt" + "# Solution\n", + "echo 'hello world' > greeting.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Series 3 \u2013 Redirections and Pipes\n\nFocus: Redirect input/output, combine with pipes." + "## Series 3 – Redirections and Pipes\n", + "\n", + "Focus: Redirect input/output, combine with pipes." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.1 \u2013 Save `ls` output to file" + "### Exercise 3.1 – Save `ls` output to file" ] }, { @@ -651,20 +678,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nls > list.txt" + "# Solution\n", + "ls > list.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.2 \u2013 Append date to `list.txt`" + "### Exercise 3.2 – Append date to `list.txt`" ] }, { @@ -681,20 +709,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ndate >> list.txt" + "# Solution\n", + "date >> list.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.3 \u2013 View first 5 lines of `list.txt`" + "### Exercise 3.3 – View first 5 lines of `list.txt`" ] }, { @@ -711,20 +740,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nhead -5 list.txt" + "# Solution\n", + "head -5 list.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.4 \u2013 Count lines using pipe" + "### Exercise 3.4 – Count lines using pipe" ] }, { @@ -741,20 +771,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncat list.txt | wc -l" + "# Solution\n", + "cat list.txt | wc -l" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.5 \u2013 Redirect errors to `errors.txt`" + "### Exercise 3.5 – Redirect errors to `errors.txt`" ] }, { @@ -771,20 +802,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nls /fake 2> errors.txt" + "# Solution\n", + "ls /fake 2> errors.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.6 \u2013 Redirect both output and errors" + "### Exercise 3.6 – Redirect both output and errors" ] }, { @@ -801,20 +833,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nls /fake > all.txt 2>&1" + "# Solution\n", + "ls /fake > all.txt 2>&1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.7 \u2013 Use pipe to sort `list.txt`" + "### Exercise 3.7 – Use pipe to sort `list.txt`" ] }, { @@ -831,20 +864,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncat list.txt | sort" + "# Solution\n", + "cat list.txt | sort" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.8 \u2013 Combine commands with `| grep`" + "### Exercise 3.8 – Combine commands with `| grep`" ] }, { @@ -861,20 +895,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nls /etc | grep conf" + "# Solution\n", + "ls /etc | grep conf" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.9 \u2013 Use input redirection `<` to count words" + "### Exercise 3.9 – Use input redirection `<` to count words" ] }, { @@ -891,20 +926,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nwc -w < list.txt" + "# Solution\n", + "wc -w < list.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 3.10 \u2013 Chain three commands" + "### Exercise 3.10 – Chain three commands" ] }, { @@ -921,27 +957,30 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncat list.txt | sort | uniq" + "# Solution\n", + "cat list.txt | sort | uniq" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Series 4 \u2013 Viewing Results\n\nFocus: `head`, `tail`, `cat`, `grep`, `less`." + "## Series 4 – Viewing Results\n", + "\n", + "Focus: `head`, `tail`, `cat`, `grep`, `less`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.1 \u2013 Display first 10 lines of `/etc/passwd`" + "### Exercise 4.1 – Display first 10 lines of `/etc/passwd`" ] }, { @@ -958,20 +997,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nhead /etc/passwd" + "# Solution\n", + "head /etc/passwd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.2 \u2013 Show last 5 lines of `/etc/passwd`" + "### Exercise 4.2 – Show last 5 lines of `/etc/passwd`" ] }, { @@ -988,20 +1028,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ntail -5 /etc/passwd" + "# Solution\n", + "tail -5 /etc/passwd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.3 \u2013 View complete file `/etc/hostname`" + "### Exercise 4.3 – View complete file `/etc/hostname`" ] }, { @@ -1018,20 +1059,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncat /etc/hostname" + "# Solution\n", + "cat /etc/hostname" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.4 \u2013 Search for 'root' in `/etc/passwd`" + "### Exercise 4.4 – Search for 'root' in `/etc/passwd`" ] }, { @@ -1048,20 +1090,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ngrep root /etc/passwd" + "# Solution\n", + "grep root /etc/passwd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.5 \u2013 Count matches of 'bash' in `/etc/passwd`" + "### Exercise 4.5 – Count matches of 'bash' in `/etc/passwd`" ] }, { @@ -1078,20 +1121,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ngrep -c bash /etc/passwd" + "# Solution\n", + "grep -c bash /etc/passwd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.6 \u2013 Show line numbers with `grep`" + "### Exercise 4.6 – Show line numbers with `grep`" ] }, { @@ -1108,20 +1152,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ngrep -n bash /etc/passwd" + "# Solution\n", + "grep -n bash /etc/passwd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.7 \u2013 Invert match to exclude 'bash'" + "### Exercise 4.7 – Invert match to exclude 'bash'" ] }, { @@ -1138,20 +1183,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ngrep -v bash /etc/passwd" + "# Solution\n", + "grep -v bash /etc/passwd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.8 \u2013 Use `less` to browse `/etc/services`" + "### Exercise 4.8 – Use `tail` to see the 5 last lines of `/etc/services`" ] }, { @@ -1168,20 +1214,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nless /etc/services" + "# Solution\n", + "tail -5 /etc/services" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.9 \u2013 Concatenate multiple small files" + "### Exercise 4.9 – Concatenate multiple small files" ] }, { @@ -1198,20 +1245,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncat a.txt greeting.txt > merged.txt" + "# Solution\n", + "cat a.txt greeting.txt > merged.txt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 4.10 \u2013 Show sorted unique words from `list.txt`" + "### Exercise 4.10 – Show sorted unique words from `list.txt`" ] }, { @@ -1228,27 +1276,30 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\ncat list.txt | tr ' ' '\\n' | sort | uniq" + "# Solution\n", + "cat list.txt | tr ' ' '\\n' | sort | uniq" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Series 5 \u2013 Process Management\n\nFocus: `ps`, `kill`, `ctrl-c`, `ctrl-z`, `top`." + "## Series 5 – Process Management\n", + "\n", + "Focus: `ps`, `kill`, `ctrl-c`, `ctrl-z`, `top`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 5.1 \u2013 List processes" + "### Exercise 5.1 – List processes" ] }, { @@ -1265,20 +1316,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nps" + "# Solution\n", + "ps" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 5.2 \u2013 Show detailed process tree" + "### Exercise 5.2 – Show detailed process tree" ] }, { @@ -1295,20 +1347,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nps aux" + "# Solution\n", + "ps aux" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 5.3 \u2013 Find your shell PID" + "### Exercise 5.3 – Find your shell PID" ] }, { @@ -1325,20 +1378,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\necho $$" + "# Solution\n", + "echo $$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 5.4 \u2013 Launch sleep in background" + "### Exercise 5.4 – Launch sleep in background" ] }, { @@ -1355,20 +1409,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nsleep 60 &" + "# Solution\n", + "sleep 60 &" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 5.5 \u2013 List background jobs" + "### Exercise 5.5 – List background jobs" ] }, { @@ -1385,20 +1440,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\njobs" + "# Solution\n", + "jobs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 5.6 \u2013 Bring job to foreground" + "### Exercise 5.6 – Bring job to foreground" ] }, { @@ -1415,20 +1471,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nfg" + "# Solution\n", + "fg" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 5.7 \u2013 Stop a process by PID" + "### Exercise 5.7 – Stop a process by PID" ] }, { @@ -1445,20 +1502,21 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nkill " + "# Solution\n", + "kill " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Exercise 5.8 \u2013 Force kill a process" + "### Exercise 5.8 – Force kill a process" ] }, { @@ -1475,73 +1533,14 @@ "execution_count": null, "metadata": { "jupyter": { - "source_hidden": true, - "outputs_hidden": true + "outputs_hidden": true, + "source_hidden": true } }, "outputs": [], "source": [ - "# Solution\nkill -9 " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Exercise 5.9 \u2013 Display dynamic processes" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# your work here" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true, - "outputs_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\ntop" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Exercise 5.10 \u2013 Exit `top` with `q` key" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# your work here" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true, - "outputs_hidden": true - } - }, - "outputs": [], - "source": [ - "# Solution\n# press q in top" + "# Solution\n", + "kill -9 " ] } ], @@ -1557,4 +1556,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/jupyterhub_volumes/web/index.html b/jupyterhub_volumes/web/index.html index aed6471..1cf3636 100644 --- a/jupyterhub_volumes/web/index.html +++ b/jupyterhub_volumes/web/index.html @@ -115,6 +115,7 @@