mirror of
https://codeberg.org/Mo8it/How_To_Linux.git
synced 2024-12-05 01:40:32 +00:00
Compare commits
5 commits
5ff3b3e68b
...
7c3c0f88de
Author | SHA1 | Date | |
---|---|---|---|
7c3c0f88de | |||
68549eac69 | |||
db7e9aaed7 | |||
b8450900ee | |||
bc868fa8da |
12 changed files with 75 additions and 65 deletions
|
@ -3,8 +3,8 @@ authors = ["Mo Bitar"]
|
|||
language = "en"
|
||||
multilingual = false
|
||||
src = "src"
|
||||
title = "How To Linux"
|
||||
title = "Dev Tools"
|
||||
|
||||
[output.html]
|
||||
git-repository-url = "https://codeberg.org/Mo8it/How_To_Linux"
|
||||
git-repository-url = "https://codeberg.org/mo8it/dev-tools"
|
||||
git-repository-icon = "fa-code-fork"
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"markdown": {
|
||||
},
|
||||
"includes": ["**/*.{md}"],
|
||||
"excludes": [],
|
||||
"plugins": [
|
||||
"https://plugins.dprint.dev/markdown-0.14.1.wasm"
|
||||
]
|
||||
}
|
|
@ -1,19 +1,38 @@
|
|||
# How To Linux
|
||||
# Dev Tools
|
||||
|
||||
_by Mo Bitar_
|
||||
_by Mo Bitar (@mo8it)_
|
||||
|
||||
So you want to learn Linux? You want to fulfill your childhood dream and look like a hacker? Or you just want to manage some servers or escape Windows or Mac for an alternative system that is [free and open source](https://www.gnu.org/philosophy/free-sw.html.en)? Then this book is for you!
|
||||
So you want to be a developer and you wonder what hard[^hard] skills you should learn besides programming?
|
||||
Then this course is for you!
|
||||
|
||||
This book focuses on the terminal side of Linux. This means that no [GUI](https://en.wikipedia.org/wiki/Graphical_user_interface) (graphical user interface) is discussed in this book. This makes the content more useful for server usage and administration since servers normally have no GUI. Nevertheless, if you want to use Linux as a desktop, then being able to deal with the terminal is not only useful, but could even be required at some point.
|
||||
This course will not teach you how to program.
|
||||
It will not teach you any algorithms or data structures.
|
||||
It is designed to teach you skills that almost every developer needs but are not taught in lectures or the like.
|
||||
|
||||
You might ask, why not just use a GUI for everything? Hopefully, this book will let you understand why. A [CLI](https://en.wikipedia.org/wiki/Command-line_interface) (command line interface) is not well suited for everything. But for many tasks, a CLI might be much more powerful. It allows automation and enables you to use it as a component to build something bigger.
|
||||
It all starts with the terminal.
|
||||
|
||||
This book is intended to be used within a 5 days course[^course]. Therefore, the main sections are the 5 days. It is assumed that you read the book from the beginning to the end. If you skip some sections, you might not understand something in later sections.
|
||||
You can try to run away from the terminal and look for a [GUI](https://en.wikipedia.org/wiki/Graphical_user_interface) (graphical user interface) for every task.
|
||||
But learning how to work in the terminal will unlock powerful capabilities as a developer and bring you to a next level of productivity.
|
||||
Not only will you be able to host and administrate servers (since they usually don't have a GUI).
|
||||
You will also be able to automate tasks and glue programs together like a wizard 🪄
|
||||
|
||||
The book also contains some tasks to help practice and experiment with what you have learned on your way.
|
||||
When we talk about about the terminal for developers, we of course mean the Linux terminal 🐧
|
||||
|
||||
Are you excited? Lets start the journey!
|
||||
Windows also has a "terminal", but it is so useless that Microsoft itself started to offer a Linux system inside Windows[^wsl].
|
||||
MacOS being a [Unix-like](https://en.wikipedia.org/wiki/Unix-like) operating system offers a terminal a bit similar to that in Linux, but it is also useless in the server world.
|
||||
|
||||
This course is a 5 days course[^course] and should be read from the start to the end.
|
||||
If you skip some sections, you might not understand everything in later sections.
|
||||
|
||||
The course contains tasks to help you practice and experiment with what you have learned.
|
||||
|
||||
Are you excited?
|
||||
Let's start the journey!
|
||||
|
||||
---
|
||||
|
||||
[^course]: The book started with a vacation course on the Johannes Gutenberg university in Mainz, Germany.
|
||||
[^hard]: Hard skills as the opposite of soft skills; not hard as in difficulty.
|
||||
|
||||
[^wsl]: See [Windows subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/) which actually should be called "Linux subsystem for Windows".
|
||||
|
||||
[^course]: The course started as a vacation course on the Johannes Gutenberg university in Mainz, Germany.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Day 1
|
||||
|
||||
In this day, you will learn the basics of Linux in the terminal.
|
||||
In this day, you will learn the basics of the Linux terminal.
|
||||
|
||||
But before we start with the basics, the first section discusses why you should learn Linux in the first place.
|
||||
|
|
|
@ -26,7 +26,7 @@ It is important to understand the functionality of package managers. Then you ca
|
|||
|
||||
To install a package, you need administrative privileges. Therefore, we need some `sudo` powers. `sudo` will be explained in the next section.
|
||||
|
||||
Lets install our first package! To do so, enter `sudo dnf install cmatrix`. You will be asked for the password of your user. Type the password and then press `Enter`. For security reasons, you will not be able to see you password while entering it. So don't wonder why nothing happens while typing the password. Just type it and then press `Enter`.
|
||||
Let's install our first package! To do so, enter `sudo dnf install cmatrix`. You will be asked for the password of your user. Type the password and then press `Enter`. For security reasons, you will not be able to see you password while entering it. So don't wonder why nothing happens while typing the password. Just type it and then press `Enter`.
|
||||
|
||||
The package manager might need some time to synchronize some data, then it will show you a summary of what it will do and ask you for confirmation. Type `y` for _yes_ and then press `Enter` for the installation to start.
|
||||
|
||||
|
@ -46,7 +46,7 @@ Why do we speak about _packages_ instead of programs when installing software on
|
|||
|
||||
[![](https://imgs.xkcd.com/comics/sandwich.png)](https://xkcd.com/149/)
|
||||
|
||||
Lets try to install another package, this time without `sudo` at the beginning of the command.
|
||||
Let's try to install another package, this time without `sudo` at the beginning of the command.
|
||||
|
||||
```console
|
||||
$ dnf install cowsay
|
||||
|
|
|
@ -53,6 +53,6 @@ Make a screenshot of some cow wisdom 🐮
|
|||
|
||||
Now install the package `lolcat`.
|
||||
|
||||
Lets say the wisdom command you did take the last screenshot of is `cowsay (...)`. Now run `cowsay (...) | lolcat`. Describe what changed. Can you guess how this internally works?
|
||||
Let's say the wisdom command you did take the last screenshot of is `cowsay (...)`. Now run `cowsay (...) | lolcat`. Describe what changed. Can you guess how this internally works?
|
||||
|
||||
Now read the help of `lolcat` and find out how to add some randomness. Run the command above again with the option you found and take a screenshot after you are satisfied with the randomness you get.
|
||||
|
|
|
@ -16,7 +16,7 @@ It is like a chat with your computer. But your computer is not into memes. It is
|
|||
|
||||
### Echo
|
||||
|
||||
Lets enter a command, probably your first command. Type `echo "Hello!"` and press enter. This is the output:
|
||||
Let's enter a command, probably your first command. Type `echo "Hello!"` and press enter. This is the output:
|
||||
|
||||
```console
|
||||
$ echo "Hello!"
|
||||
|
@ -33,7 +33,7 @@ I know, I did just brake the romance between you and your computer. I apologize.
|
|||
|
||||
### Navigation
|
||||
|
||||
Lets try more commands. type `ls` and press enter. What do you see?
|
||||
Let's try more commands. type `ls` and press enter. What do you see?
|
||||
|
||||
The output is going to be the files and directories in your current path. `ls` stands for _list_.
|
||||
|
||||
|
@ -41,7 +41,7 @@ What if you want to take a look at the content of a different directory at a dif
|
|||
|
||||
To examine this, lets first create a new directory. Enter the command `mkdir empty_house`. Well, you don't see anything? Did the command do something at all? To verify this, run `ls` again. Now you should see your new directory `empty_house` listed too! `mkdir` stands for _make directory_. `empty_house` is just a name for our new directory. You could have used `mkdir Images` for example to create a directory called `Images`.
|
||||
|
||||
Is `empty_house` really empty? Lets verify that.
|
||||
Is `empty_house` really empty? Let's verify that.
|
||||
|
||||
Enter the command `cd empty_house`. Again, you don't see an output. But maybe you did notice that a part of your prompt changed from `~` to `empty_house`. This indicates that you are in your new directory. `cd` stands for _change directory_.
|
||||
|
||||
|
@ -49,7 +49,7 @@ Now enter the command `ls`. You should not be seeing anything because the direct
|
|||
|
||||
### Create, rename, move
|
||||
|
||||
An empty house is a sad house. Lets give the house directory some friends to live within it. Enter the command `touch friend1.txt`. Now enter `ls` again:
|
||||
An empty house is a sad house. Let's give the house directory some friends to live within it. Enter the command `touch friend1.txt`. Now enter `ls` again:
|
||||
|
||||
```console
|
||||
$ ls
|
||||
|
@ -58,7 +58,7 @@ friend1.txt
|
|||
|
||||
You should see the first friend of the empty directory. `touch` creates a file if it does not exist. It does also have another use case which is not relevant at this moment.
|
||||
|
||||
But wait, our directory `empty_house` is not empty anymore! Lets fix that by renaming it.
|
||||
But wait, our directory `empty_house` is not empty anymore! Let's fix that by renaming it.
|
||||
|
||||
Enter the command `cd ..` to go one directory back. The two dots `..` refer to the parent directory in Linux.
|
||||
|
||||
|
@ -66,16 +66,16 @@ Now that you are back in `~`, enter `mv empty_house happy_house`. Now enter `ls`
|
|||
|
||||
Moving is not the same as renaming, right? Well, `mv` does move a file or directory to a new destination with the possibility to give the file or directory a new name on the destination. So we did _move_ the directory `empty_house` to the same location, but we did give it a new name.
|
||||
|
||||
I know, it is tricky. Lets take a look at an example that does actually _move_. Enter the command `touch friend2.txt friend3.txt`. This will create two new files at the same time. This way, you don't have to type `touch friend2.txt` **and** `touch friend3.txt`.
|
||||
I know, it is tricky. Let's take a look at an example that does actually _move_. Enter the command `touch friend2.txt friend3.txt`. This will create two new files at the same time. This way, you don't have to type `touch friend2.txt` **and** `touch friend3.txt`.
|
||||
|
||||
Now lets move one of our new text files. Enter `mv friend2.txt happy_house`. Enter `ls` to see that `friend2.txt` did disappear. Lets verify that it now lives in `happy_house`. You could use `mv happy_house` and then `ls` analogously to the strategy above. But it is faster to use `ls` directly. Enter `ls happy_house`:
|
||||
Now lets move one of our new text files. Enter `mv friend2.txt happy_house`. Enter `ls` to see that `friend2.txt` did disappear. Let's verify that it now lives in `happy_house`. You could use `mv happy_house` and then `ls` analogously to the strategy above. But it is faster to use `ls` directly. Enter `ls happy_house`:
|
||||
|
||||
```console
|
||||
$ ls happy_house
|
||||
friend1.txt friend2.txt
|
||||
```
|
||||
|
||||
We did verify that `friend2.txt` was moved. Lets move `friend3.txt`, too. Enter `mv friend3.txt happy_house/loud_friend.txt`. Take a look at the content of your directory now:
|
||||
We did verify that `friend2.txt` was moved. Let's move `friend3.txt`, too. Enter `mv friend3.txt happy_house/loud_friend.txt`. Take a look at the content of your directory now:
|
||||
|
||||
```console
|
||||
$ ls happy_house
|
||||
|
@ -86,7 +86,7 @@ We did not only move `friend3.txt`. We did also give it a new name in the destin
|
|||
|
||||
### Remove
|
||||
|
||||
What if our house is not really _happy_ anymore since a loud friend did move in? Lets remove that loud friend!
|
||||
What if our house is not really _happy_ anymore since a loud friend did move in? Let's remove that loud friend!
|
||||
|
||||
Enter `cd happy_house` and then `rm loud_friend.txt`. You will not see any output, but lets see what has changed in the directory:
|
||||
|
||||
|
@ -99,7 +99,7 @@ The loud friend is removed! `rm` stand for _remove_.
|
|||
|
||||
> **Warning** ⚠️ : `rm` deletes a file directly! The file is not moved to a trash! It is gone! You can not restore it anymore! Think more than one time before using `rm`.
|
||||
|
||||
Does `rm` also work with directories? Lets test it:
|
||||
Does `rm` also work with directories? Let's test it:
|
||||
|
||||
```console
|
||||
$ ls
|
||||
|
@ -119,7 +119,7 @@ $ ls
|
|||
friend1.txt friend2.txt
|
||||
```
|
||||
|
||||
`rmdir` stands for _remove directory_. But it does only work on empty directories! Lets verify this on none empty directories:
|
||||
`rmdir` stands for _remove directory_. But it does only work on empty directories! Let's verify this on none empty directories:
|
||||
|
||||
```console
|
||||
$ ls
|
||||
|
@ -160,7 +160,7 @@ You probably wonder what `tree` is. As you can see in the output above, it shows
|
|||
|
||||
Now, we want to write some rules to avoid having loud people or zombies again.
|
||||
|
||||
Lets first make sure that we are in our house directory first. To do so, enter `pwd`:
|
||||
Let's first make sure that we are in our house directory first. To do so, enter `pwd`:
|
||||
|
||||
```console
|
||||
$ pwd
|
||||
|
@ -175,14 +175,14 @@ There are many ways to edit text files in the terminal. The simplest method is t
|
|||
|
||||
Enter the command `nano rules.txt`. You will be presented with a "terminal window" showing a blinking cursor and some shortcuts at the bottom.
|
||||
|
||||
Lets write some rules, for example:
|
||||
Let's write some rules, for example:
|
||||
|
||||
```
|
||||
No zombies!
|
||||
No loud housemates!
|
||||
```
|
||||
|
||||
How to save and exit? Lets take a look at the shortcuts at the bottom. The shortcuts starting with the symbol `^` expect the `Ctrl` key. Those starting with `M-` expect the `Alt` key. To save, we use `^X` which means that we have to press `Ctrl` and then press `X` while holding `Ctrl`.
|
||||
How to save and exit? Let's take a look at the shortcuts at the bottom. The shortcuts starting with the symbol `^` expect the `Ctrl` key. Those starting with `M-` expect the `Alt` key. To save, we use `^X` which means that we have to press `Ctrl` and then press `X` while holding `Ctrl`.
|
||||
|
||||
Now, it asks us:
|
||||
|
||||
|
@ -202,7 +202,7 @@ File Name to Write: rules.txt
|
|||
|
||||
We want to keep the name that we did specify. Therefore, we press `Enter`. Otherwise, you can change the name and save the file under another name.
|
||||
|
||||
Lets take a look at our rules:
|
||||
Let's take a look at our rules:
|
||||
|
||||
```console
|
||||
$ ls
|
||||
|
@ -229,7 +229,7 @@ I do not memorize everything! I had to look up the meaning of the three numbers.
|
|||
|
||||
You could use the internet, but (almost) every Linux command comes with a manual. To access the manual of a command, we use the command `man` followed by the name of the command that we want to look up. `man` stands for _manual_.
|
||||
|
||||
Lets look up the command `wc`:
|
||||
Let's look up the command `wc`:
|
||||
|
||||
```console
|
||||
$ man wc
|
||||
|
@ -272,7 +272,7 @@ The second section is _SYNOPSIS_ and shows different ways of using the command.
|
|||
|
||||
The options are presented in the section _DESCRIPTION_ that also explains the command with more details.
|
||||
|
||||
Lets pick one option: `-l, --lines`. The first part `-l` shows that short version of the option (not always given). The second part `--lines` shows the long version of the option which is also more verbose. The description below tells us that the option prints the newline counts. We can try it out, but first, you might already be in the panic mode because you might not find out know how to exit this manual.
|
||||
Let's pick one option: `-l, --lines`. The first part `-l` shows that short version of the option (not always given). The second part `--lines` shows the long version of the option which is also more verbose. The description below tells us that the option prints the newline counts. We can try it out, but first, you might already be in the panic mode because you might not find out know how to exit this manual.
|
||||
|
||||
HOW CAN I EXIT THIS MANUAL? DO I HAVE TO EXIT THE TERMINAL AND OPEN A NEW ONE? 😱
|
||||
|
||||
|
@ -291,7 +291,7 @@ $ wc --lines rules.txt
|
|||
|
||||
You can see that `-l` and `--lines` are equivalent and they lead to returning the number of lines.
|
||||
|
||||
Lets try using more than one option:
|
||||
Let's try using more than one option:
|
||||
|
||||
```console
|
||||
$ wc -l -w rules.txt
|
||||
|
@ -318,7 +318,7 @@ Try `wc --help`!
|
|||
|
||||
### Paths
|
||||
|
||||
Lets build one more house!
|
||||
Let's build one more house!
|
||||
|
||||
```console
|
||||
$ cd ~
|
||||
|
@ -330,7 +330,7 @@ We did not use any new commands, but what is this symbol `~`? We did already men
|
|||
|
||||
By entering `cd ~`, we did make sure that we are in our "home" before creating a new directory. Entering only `cd` does have the same effect as `cd ~`.
|
||||
|
||||
So we did create a new house directory and move into it. Lets say we want to copy the rules from the first house to the new one while we are in the new one. To do so, we can use the command `cp` that stand for _copy_:
|
||||
So we did create a new house directory and move into it. Let's say we want to copy the rules from the first house to the new one while we are in the new one. To do so, we can use the command `cp` that stand for _copy_:
|
||||
|
||||
```console
|
||||
$ pwd
|
||||
|
@ -367,7 +367,7 @@ In the **4. command**, we use the dot `.` as a shortcut to the current directory
|
|||
|
||||
In the **5. command**, we use the two dots `..` instead of `~` which is also possible since the parent directory is `~` in this case. The two dots are useful when we are operating in directories that are nested deeper in the home directory.
|
||||
|
||||
You might think: `.` is the path to the current directory. `..` is the path of the parent directory. Is `...` the path of the parent directory of the parent directory? Lets try it out:
|
||||
You might think: `.` is the path to the current directory. `..` is the path of the parent directory. Is `...` the path of the parent directory of the parent directory? Let's try it out:
|
||||
|
||||
```console
|
||||
$ ls .
|
||||
|
@ -395,7 +395,7 @@ One thing has to be mentioned about `cp`: To copy directories instead of just fi
|
|||
|
||||
### Terminal shortcuts
|
||||
|
||||
For typing a long path, you can use the **autocompletion**. Go back to the home directory using `cd`. Lets say that we want to read the rules of the directory `happy_house`. Type `cat hap` without hitting enter yet. Now press `Tab` and see how the path is autocompleted to `cat happy_house/`. Now type `ru` and hit `Tab` again. Then you have `cat happy_house/rules.txt`. Much faster, right?
|
||||
For typing a long path, you can use the **autocompletion**. Go back to the home directory using `cd`. Let's say that we want to read the rules of the directory `happy_house`. Type `cat hap` without hitting enter yet. Now press `Tab` and see how the path is autocompleted to `cat happy_house/`. Now type `ru` and hit `Tab` again. Then you have `cat happy_house/rules.txt`. Much faster, right?
|
||||
|
||||
If you have another directory in your home that is called something like `happy_directory`, then the autocompletion completes only to `cat happy_`. Pressing `Tab` again shows you the possible options. Type one or more characters to make an autocompletion possible and then hit `Tab` again to have the directory name autocompleted.
|
||||
|
||||
|
@ -417,7 +417,7 @@ If you want to go to the beginning of the command, press `Ctrl + a`. Then you ca
|
|||
|
||||
If you want to close a session quickly, press `Ctrl + d`. For now, this will close your terminal. Later, when we use SSH to access other Linux machines, `Ctrl + d` will close the connection and bring you back to the prompt of your machine.
|
||||
|
||||
Lets write a very small program in Python. Enter `nano nonstop.py` and type in the following small snippet:
|
||||
Let's write a very small program in Python. Enter `nano nonstop.py` and type in the following small snippet:
|
||||
|
||||
```python
|
||||
from time import sleep
|
||||
|
|
|
@ -4,7 +4,7 @@ When you run something in the terminal, then you are interacting with the so cal
|
|||
|
||||
The default shell on almost all Linux systems is `bash`. (We will learn about the `fish` shell later 🐠)
|
||||
|
||||
The shell has the power to glue commands together to make the impossible possible! Lets use some gluing magic!
|
||||
The shell has the power to glue commands together to make the impossible possible! Let's use some gluing magic!
|
||||
|
||||
## Piping
|
||||
|
||||
|
@ -22,12 +22,12 @@ You might have guessed it now, make some `wc` pipes.
|
|||
|
||||
OK, I admit that the naming is not the best 😂
|
||||
|
||||
Lets get some data to work with. To do so, we will use the command `curl` which graps content from the internet.
|
||||
Let's get some data to work with. To do so, we will use the command `curl` which graps content from the internet.
|
||||
|
||||
Lets count the number of lines of the html file of the homepage of this book:
|
||||
Let's count the number of lines of the html file of the homepage of this book:
|
||||
|
||||
```console
|
||||
$ curl -s https://how-to-linux.mo8it.xyz | wc -l
|
||||
$ curl -s https://how-to-linux.mo8it.com | wc -l
|
||||
220
|
||||
```
|
||||
|
||||
|
@ -54,7 +54,7 @@ We did just filter the output of the help of a command. This way, you can also s
|
|||
Back to the main example:
|
||||
|
||||
```console
|
||||
$ curl -s https://how-to-linux.mo8it.xyz | grep "Linux" | wc -l
|
||||
$ curl -s https://how-to-linux.mo8it.com | grep "Linux" | wc -l
|
||||
7
|
||||
```
|
||||
|
||||
|
@ -78,12 +78,12 @@ You can redirect the standard output or the standard error to a file!
|
|||
|
||||
## Redirections
|
||||
|
||||
Lets see how you can redirect the output of commands to a file.
|
||||
Let's see how you can redirect the output of commands to a file.
|
||||
|
||||
If you just run `curl -s https://how-to-linux.mo8it.xyz`, you will see the html file printed to the terminal. Lets redirect the output to a html file on your disk:
|
||||
If you just run `curl -s https://how-to-linux.mo8it.com`, you will see the html file printed to the terminal. Let's redirect the output to a html file on your disk:
|
||||
|
||||
```console
|
||||
$ curl -s https://how-to-linux.mo8it.xyz > how-to-linux.html
|
||||
$ curl -s https://how-to-linux.mo8it.com > how-to-linux.html
|
||||
```
|
||||
|
||||
Now view the content of the new file `how-to-linux.html`. You will see the same output from the terminal without redirection.
|
||||
|
@ -91,7 +91,7 @@ Now view the content of the new file `how-to-linux.html`. You will see the same
|
|||
Now try this command:
|
||||
|
||||
```console
|
||||
$ curl https://non-existent-site.mo8it.xyz > test.html
|
||||
$ curl https://non-existent-site.mo8it.com > test.html
|
||||
curl: (60) SSL certificate problem: self-signed certificate
|
||||
More details here: https://curl.se/docs/sslcerts.html
|
||||
|
||||
|
@ -106,7 +106,7 @@ You will see that the file is empty since `curl` did not find a page to show as
|
|||
If you are using this command in a script, then it might be wise to redirect the error to a log file:
|
||||
|
||||
```console
|
||||
$ curl https://non-existent-site.mo8it.xyz 2> curl.log
|
||||
$ curl https://non-existent-site.mo8it.com 2> curl.log
|
||||
$ cat curl.log
|
||||
curl: (60) SSL certificate problem: self-signed certificate
|
||||
More details here: https://curl.se/docs/sslcerts.html
|
||||
|
|
|
@ -6,7 +6,7 @@ Since `bash` is the default shell on most Linux distributions, we learn bash scr
|
|||
|
||||
## First bash script
|
||||
|
||||
Lets write our first Bash script:
|
||||
Let's write our first Bash script:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/bash
|
||||
|
@ -73,7 +73,7 @@ This means that we can now write this script:
|
|||
print("Hello world!")
|
||||
```
|
||||
|
||||
Lets save this tiny Python script as `hello_world.py`, make it executable with `chmod` (will be explained later) and then run it:
|
||||
Let's save this tiny Python script as `hello_world.py`, make it executable with `chmod` (will be explained later) and then run it:
|
||||
|
||||
```console
|
||||
$ chmod u+x hello_world.py
|
||||
|
@ -128,7 +128,7 @@ BASH_VERSION=$(bash --version)
|
|||
|
||||
The line above saves the output of the command `bash --version` in the variable `BASH_VERSION`.
|
||||
|
||||
Lets run the command in the terminal first to see its output:
|
||||
Let's run the command in the terminal first to see its output:
|
||||
|
||||
```console
|
||||
$ bash --version
|
||||
|
@ -163,7 +163,7 @@ This is the output that we did expect 😃
|
|||
|
||||
## Temporary variables
|
||||
|
||||
Lets write the following tiny script `hello.sh`:
|
||||
Let's write the following tiny script `hello.sh`:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/bash
|
||||
|
|
|
@ -192,7 +192,7 @@ rsync -Lahz SRC_PATH HOST:DEST_PATH
|
|||
|
||||
Options:
|
||||
|
||||
- `-a`, `--archieve`: Set of useful options to preserve permissions, use recursive mode, etc.
|
||||
- `-a`, `--archive`: Set of useful options to preserve permissions, use recursive mode, etc.
|
||||
- `-h`, `--human-readable`: Output number in a human-readable format.
|
||||
- `-z`, `--compress`: Use compression.
|
||||
- `--partial`: Continue after interruption.
|
||||
|
|
|
@ -73,7 +73,7 @@ Now that you have the program `tmate`, find out what it does! Try it with a seco
|
|||
|
||||
> 📍 : In this task, you should connect as the user `admin` to the Contabo server. **Don't do this task as the user that you did create on the server!** ⚠️
|
||||
|
||||
> 📍 : Starting with this task: Asking you to replace `N` means to enter the number that you are using in the URL `ttydN.mo8it.xyz`.
|
||||
> 📍 : Starting with this task: Asking you to replace `N` means to enter the number that you are using in the URL `ttydN.mo8it.com`.
|
||||
|
||||
In this task, you will host a static website which is a website that does not have a backend. A static website is just a set of HTML, CSS (and optionally JavaScript) files.
|
||||
|
||||
|
@ -169,7 +169,7 @@ Create a container for the database with the following options:
|
|||
|
||||
Create the actual Nextcloud container with the following options:
|
||||
|
||||
- Container name: `nextcloudN`. `N` at the end stands for the number that you are using in the url to connect to the browser terminal `ttydN.mo8it.xyz`.
|
||||
- Container name: `nextcloudN`. `N` at the end stands for the number that you are using in the url to connect to the browser terminal `ttydN.mo8it.com`.
|
||||
- Timezone `tz`: `local`
|
||||
- Network: `traefik`
|
||||
- Volume: Mount the directory `nextcloudN` that you did create into `/var/www/html` in the container. Use the label `Z`!
|
||||
|
|
|
@ -88,7 +88,7 @@ In this task, you will learn using Lazygit.
|
|||
1. Run `lazygit`. It will initialize a git repository in this directory if none already exists. Confirm the initialization. Starting with now, every git operation should be done in Lazygit.
|
||||
1. Add everything as staged.
|
||||
1. Commit.
|
||||
1. Create a repository on [git.mo8it.xyz](https://git.mo8it.xyz).
|
||||
1. Create a repository on [git.mo8it.com](https://git.mo8it.com).
|
||||
1. Add the new remote.
|
||||
1. Push to the new remote.
|
||||
1. Modify a file (or multiple files).
|
||||
|
|
Loading…
Reference in a new issue