Add lesson 1: The prompt and the file system
3 changed files with 30 additions and 0 deletions
lessons/01-the-prompt-and-the-file-system/README.md ADDED
| @@ -0,0 +1,19 @@ | ||
| 1 | +# Lesson 1: The prompt and the file system | |
| 2 | + | |
| 3 | +The prompt and the file system comes up in almost every real shell project. We start with the why, then write code together. | |
| 4 | + | |
| 5 | +Full lesson: [https://glibcode.net/courses/linux-shell/lessons/1](https://glibcode.net/courses/linux-shell/lessons/1) | |
| 6 | + | |
| 7 | +## Files | |
| 8 | + | |
| 9 | +- `commands.sh`: where you are and what is around you | |
| 10 | + | |
| 11 | +## Run it | |
| 12 | + | |
| 13 | +```sh | |
| 14 | +# type the commands from commands.sh one by one; don't run it as a script | |
| 15 | +``` | |
| 16 | + | |
| 17 | +## Exercises | |
| 18 | + | |
| 19 | +See [exercises.md](exercises.md). Ask in the forum once you've tried. | |
lessons/01-the-prompt-and-the-file-system/commands.sh ADDED
| @@ -0,0 +1,6 @@ | ||
| 1 | +pwd | |
| 2 | +ls -la | |
| 3 | +cd /var/log && ls | |
| 4 | +cd ~ # home | |
| 5 | +cd - # back to where you were | |
| 6 | +tree -L 2 ~/projects 2>/dev/null || find ~/projects -maxdepth 2 | |
lessons/01-the-prompt-and-the-file-system/exercises.md ADDED
| @@ -0,0 +1,5 @@ | ||
| 1 | +# Exercises: lesson 1 | |
| 2 | + | |
| 3 | +1. Run `commands.sh` and change one value. Write down what you expect, then run it again and compare. | |
| 4 | +2. Combine this lesson with the previous one: use something from both in a small program of your own. | |
| 5 | +3. Look up one function or command the example uses in the official documentation. Note one option you didn't know. | |