From f01c2ac966604d217d934cf0b8cd6ff1f9942413 Mon Sep 17 00:00:00 2001 From: Antoine Le Morvan Date: Mon, 3 Jan 2022 17:25:35 +0100 Subject: [PATCH] fix: try to add 2 spaces after "!!! Admonitions" - see crowdin issue --- docs/books/admin_guide/01-presentation.md | 2 +- docs/books/admin_guide/03-commands.md | 32 +++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/books/admin_guide/01-presentation.md b/docs/books/admin_guide/01-presentation.md index a018c5bcf4..bd5a6d5ad4 100644 --- a/docs/books/admin_guide/01-presentation.md +++ b/docs/books/admin_guide/01-presentation.md @@ -29,7 +29,7 @@ In this chapter you will learn about GNU/Linux distributions. Linux, UNIX, BSD, Windows, and MacOS are all **operating systems**. -!!! abstract +!!! abstract An operating system is a **set of programs that manages the available resources of a computer**. Among this management of resources, the operating system has to: diff --git a/docs/books/admin_guide/03-commands.md b/docs/books/admin_guide/03-commands.md index 13b1ee81d0..d59b3db334 100644 --- a/docs/books/admin_guide/03-commands.md +++ b/docs/books/admin_guide/03-commands.md @@ -275,7 +275,7 @@ The `clear` command clears the contents of the terminal screen. In fact, to be m In a terminal, the display will be permanently hidden, whereas in a graphical interface, a scrollbar will allow you to go back in the history of the virtual terminal. -!!! Tip +!!! Tip CTRL + L will have the same effect as the `clear` command ### `echo` command @@ -317,7 +317,7 @@ $ date -d 20210517 +%j In this last example, the `-d` option displays a given date. The `+%j` option formats this date to show only the day of the year. -!!! Warning +!!! Warning The format of a date can change depending on the value of the language defined in the environment variable `$LANG`. The date display can follow the following formats: @@ -502,7 +502,7 @@ $ ls -lia /home | `25 oct. 08:10` | Last modified date. | | `rockstar` | The name of the file (or directory). | -!!! Note +!!! Note **Aliases** are frequently positioned in common distributions. This is the case of the alias `ll`: @@ -610,7 +610,7 @@ The "rockstar" directory must exist to create the "work" directory. Otherwise, the `-p` option should be used. The `-p` option creates the parent directories if they do not exist. -!!! Danger +!!! Danger It is not recommended to use Linux command names as directory or file names. ### `touch` command @@ -633,7 +633,7 @@ $ touch /home/rockstar/myfile Date format: `[AAAA]MMJJhhmm[ss]` -!!! Tip +!!! Tip The `touch` command is primarily used to create an empty file, but it can be useful for incremental or differential backups for example. Indeed, the only effect of executing a `touch` on a file will be to force it to be saved during the next backup. ### `rmdir` command @@ -650,7 +650,7 @@ $ rmdir /home/rockstar/work | ----------------------------------------------------------------------- | ----------- | | `-p` | Removes the parent directory or directories provided if they are empty. | -!!! Tip +!!! Tip To delete both a non-empty directory and its contents, use the `rm` command. ### `rm` command @@ -661,7 +661,7 @@ The `rm` command deletes a file or directory. rm [-f] [-r] file [file] [...] ``` -!!! Danger +!!! Danger Any deletion of a file or directory is final. | Options | Information | @@ -670,7 +670,7 @@ rm [-f] [-r] file [file] [...] | `-i` | Requires confirmation of deletion. | | `-r` | Recursively deletes subdirectories. | -!!! Note +!!! Note The `rm` command itself does not ask for confirmation when deleting files. However, with a RedHat/Rocky distribution, `rm` does ask for confirmation of deletion because the `rm` command is an `alias` of the `rm -i` command. Don't be surprised if on another distribution, like Debian for example, you don't get a confirmation request. Deleting a folder with the `rm` command, whether the folder is empty or not, will require the `-r` option to be added. @@ -1123,7 +1123,7 @@ $ find /tmp -name *.txt -exec rm -f {} \; The previous command searches for all files in the `/tmp` directory named `*.txt` and deletes them. -!!! Tip "Understand the `-exec` option" +!!! Tip "Understand the `-exec` option" In the example above, the `find` command will construct a string representing the command to be executed. If the `find` command finds three files named `log1.txt`, `log2.txt`, and `log3.txt`, then the `find` command will construct the string by replacing in the string `rm -f {} \;` the braces with one of the results of the search, and do this as many times as there are results. @@ -1136,7 +1136,7 @@ The previous command searches for all files in the `/tmp` directory named `*.txt The `;` character is a special shell character that must be protected by a `\` to prevent it from being interpreted too early by the `find` command (and not in the `-exec`). -!!! Tip +!!! Tip `$ find /tmp -name *.txt -delete` does the same thing. ### `whereis` command @@ -1189,7 +1189,7 @@ The `grep` command returns the complete line containing the string you are looki $ grep -w "^root" /etc/passwd ``` -!!! Note +!!! Note This command is very powerful and it is highly recommended to consult its manual. It has many derivatives. It is possible to search for a string in a file tree with the `-R` option. @@ -1234,10 +1234,10 @@ $ find /home -name "test[123]*" /home/rockstar/test362 ``` -!!! Note +!!! Note Always surround words containing meta-characters with `"` to prevent them from being replaced by the names of files that meet the criteria. -!!! Warning +!!! Warning Do not confuse shell meta-characters with regular expression meta-characters. The `grep` command uses regular expression meta-characters. ## Redirects and pipes @@ -1267,7 +1267,7 @@ It is possible to redirect the input stream from another file with the character $ ftp -in serverftp << ftp-commands.txt ``` -!!! Note +!!! Note Only commands that require keyboard input will be able to handle input redirection. Input redirection can also be used to simulate user interactivity. The command will read the input stream until it encounters the defined keyword after the input redirection. @@ -1294,7 +1294,7 @@ STOP The shell exits the `ftp` command when it receives a line containing only the keyword. -!!! Warning +!!! Warning The ending keyword, here `END` or `STOP`, must be the only word on the line and must be at the beginning of the line. The standard input redirection is rarely used because most commands accept a filename as an argument. @@ -1448,7 +1448,7 @@ For permanent use, they must be created in the: * `.bashrc` file in the user's login directory; * `/etc/profile.d/alias.sh` file for all users. -!!! Warning +!!! Warning Special care must be taken when using aliases which can be potentially dangerous! For example, an alias set up without the administrator's knowledge: ```bash