From d323dd54a7a121ca96f182bb04512dc48a97e3e2 Mon Sep 17 00:00:00 2001 From: Antoine Le Morvan Date: Fri, 29 Dec 2023 15:07:16 +0100 Subject: [PATCH 1/6] fix: fix linter problems - nested list - list - trailing whitespaces - remove $ on online command (no return) as suggested by linter I also add the markdown extension keys (++ctrl+a++). It could be better for us to use pure markdown (to test in pdf to see how it's rendering) --- docs/books/admin_guide/00-toc.md | 3 +- docs/books/admin_guide/01-presentation.md | 103 ++++++++------ docs/books/admin_guide/03-commands.md | 162 ++++++++++++---------- 3 files changed, 144 insertions(+), 124 deletions(-) diff --git a/docs/books/admin_guide/00-toc.md b/docs/books/admin_guide/00-toc.md index 623f3256ff..e283125647 100644 --- a/docs/books/admin_guide/00-toc.md +++ b/docs/books/admin_guide/00-toc.md @@ -1,6 +1,7 @@ --- title: Learning Linux With Rocky --- + # Learning Linux with Rocky @@ -22,6 +23,4 @@ Backup and Restoration is essential info for the System Administrator. Linux com System Startup is also an important read because management of the system during the boot process has evolved significantly in recent years since the arrival of the systemd. - Final chapters address Task Management, Implementing the Network, and Software Management including installation. - diff --git a/docs/books/admin_guide/01-presentation.md b/docs/books/admin_guide/01-presentation.md index feab377210..56fb6ef155 100644 --- a/docs/books/admin_guide/01-presentation.md +++ b/docs/books/admin_guide/01-presentation.md @@ -1,6 +1,7 @@ --- title: Introduction to Linux --- + # Introduction to the Linux Operating System @@ -10,15 +11,16 @@ In this chapter you will learn about GNU/Linux distributions. **Objectives**: In this chapter you will learn how to: -:heavy_check_mark: Describe the features and possible architectures of an operating system. -:heavy_check_mark: Recount the history of UNIX and GNU/Linux. -:heavy_check_mark: Choose the right Linux distribution for your needs. -:heavy_check_mark: Explain the philosophy of Free and Open-source Software. -:heavy_check_mark: Discover the usefulness of the shell. +:heavy_check_mark: Describe the features and possible architectures of an operating system. +:heavy_check_mark: Recount the history of UNIX and GNU/Linux. +:heavy_check_mark: Choose the right Linux distribution for your needs. +:heavy_check_mark: Explain the philosophy of Free and Open-source Software. +:heavy_check_mark: Discover the usefulness of the shell. :checkered_flag: **generalities**, **linux**, **distributions** -**Knowledge**: :star: +**Knowledge**: :star: + **Complexity**: :star: **Reading time**: 10 minutes @@ -36,13 +38,19 @@ Linux, UNIX, BSD, Windows, and MacOS are all **operating systems**. As part of this management of resources, the operating system has to: * Manage the **physical** or **virtual** memory. + * The **physical memory** is made up of the RAM bars and the processor cache memory, which are used for the execution of programs. + * The **virtual memory** is a location on the hard disk (the **swap** partition) that allows the unloading of the physical memory and the saving of the current state of the system during the electrical shutdown of the computer. + * Intercept **access to peripherals**. Software is rarely allowed to access hardware directly (except for graphics cards for very specific needs). + * Provide applications with proper **task management**. - The operating system is responsible for scheduling processes to occupy the processor. + The operating system is responsible for scheduling processes to occupy the processor + * **Protect files** from unauthorized access. + * **Collect information** about programs in use or in progress. ![Operation of an operating system](images/operating_system.png) @@ -113,12 +121,17 @@ Linux equips 100% of the top 500 supercomputers since 2018. A supercomputer is a ### Architectural design * The **kernel** is the first software component. + * It is the heart of the Linux system. * It manages the hardware resources of the system. * The other software components must go through it to access the hardware. + * The **shell** is a utility that interprets user commands and ensures their execution. + * Main shells: Bourne shell, C shell, Korn shell and Bourne-Again shell (bash). + * **Applications** are user programs including but not limited to: + * Internet browsers * Word processors * Spreadsheets @@ -161,8 +174,8 @@ Linux is based on recognized standards such as [POSIX](http://en.wikipedia.org/w * Value portability. * Do one thing and do it well. * KISS: Keep It Simple Stupid. -* "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." (__Dennis Ritchie__) -* "Unix is user-friendly. It just isn't promiscuous about which users it's friendly with." (__Steven King__) +* "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." (**Dennis Ritchie**) +* "Unix is user-friendly. It just isn't promiscuous about which users it's friendly with." (**Steven King**) ## The GNU/Linux distributions @@ -176,7 +189,7 @@ This principle allows distributions to be geared to **beginners** (Ubuntu, Linux There are many graphic environments such as **GNOME**, **KDE**, **LXDE**, **XFCE**, etc. There is something for everyone, and their **ergonomics** hold their own against Microsoft or Apple systems. -So why is there so little enthusiasm for Linux, when this system is practically **virus free**? Could it be because so many editors (Adobe) and manufacturers (Nvidia) do not play the free game and do not provide a version of their software or __drivers__ for GNU/Linux? Perhaps it's fear of change, or the difficulty of finding where to buy a Linux computer, or too few games distributed under Linux. That last excuse at least shouldn't be true for long, with the advent of the game engine Steam for Linux. +So why is there so little enthusiasm for Linux, when this system is practically **virus free**? Could it be because so many editors (Adobe) and manufacturers (Nvidia) do not play the free game and do not provide a version of their software or **drivers** for GNU/Linux? Perhaps it's fear of change, or the difficulty of finding where to buy a Linux computer, or too few games distributed under Linux. That last excuse at least shouldn't be true for long, with the advent of the game engine Steam for Linux. ![GNOME Desktop](images/01-presentation-gnome.png) @@ -254,62 +267,62 @@ There are several types of shells available and configurable on a platform or ac :heavy_check_mark: An operating system is a set of programs for managing the available resources of a computer: -- [ ] True -- [ ] False +* [ ] True +* [ ] False :heavy_check_mark: The operating system is necessary to: -- [ ] Manage physical and virtual memory -- [ ] Allow direct access to peripherals -- [ ] Subcontract the management of tasks to the processor -- [ ] Collect information about the programs used or in use +* [ ] Manage physical and virtual memory +* [ ] Allow direct access to peripherals +* [ ] Subcontract the management of tasks to the processor +* [ ] Collect information about the programs used or in use :heavy_check_mark: Among these personalities, which ones participated in the development of UNIX: -- [ ] Linus Torvalds -- [ ] Ken Thompson -- [ ] Lionel Richie -- [ ] Brian Kernighan -- [ ] Andrew Stuart Tanenbaum +* [ ] Linus Torvalds +* [ ] Ken Thompson +* [ ] Lionel Richie +* [ ] Brian Kernighan +* [ ] Andrew Stuart Tanenbaum :heavy_check_mark: The original nationality of Linus Torvalds, creator of the Linux kernel, is: -- [ ] Swedish -- [ ] Finnish -- [ ] Norwegian -- [ ] Flemish -- [ ] French +* [ ] Swedish +* [ ] Finnish +* [ ] Norwegian +* [ ] Flemish +* [ ] French :heavy_check_mark: Which of the following distributions is the oldest: -- [ ] Debian -- [ ] Slackware -- [ ] Red Hat -- [ ] Arch +* [ ] Debian +* [ ] Slackware +* [ ] Red Hat +* [ ] Arch :heavy_check_mark: Is the Linux kernel: -- [ ] Multi-tasking -- [ ] Multi-user -- [ ] Multi-processor -- [ ] Multi-core -- [ ] Cross-platform -- [ ] Open +* [ ] Multi-tasking +* [ ] Multi-user +* [ ] Multi-processor +* [ ] Multi-core +* [ ] Cross-platform +* [ ] Open :heavy_check_mark: Is free software necessarily open-source? -- [ ] True -- [ ] False +* [ ] True +* [ ] False :heavy_check_mark: Is open-source software necessarily free? -- [ ] True -- [ ] False +* [ ] True +* [ ] False :heavy_check_mark: Which of the following is not a shell: -- [ ] Jason -- [ ] Jason-Bourne shell (jbsh) -- [ ] Bourne-Again shell (bash) -- [ ] C shell (csh) -- [ ] Korn shell (ksh) +* [ ] Jason +* [ ] Jason-Bourne shell (jbsh) +* [ ] Bourne-Again shell (bash) +* [ ] C shell (csh) +* [ ] Korn shell (ksh) diff --git a/docs/books/admin_guide/03-commands.md b/docs/books/admin_guide/03-commands.md index a34c700c47..aed32359e5 100644 --- a/docs/books/admin_guide/03-commands.md +++ b/docs/books/admin_guide/03-commands.md @@ -3,7 +3,7 @@ title: Linux Commands author: Antoine Le Morvan contributors: Steven Spencer, Aditya Putta, tianci li, Grammaresque, Ganna Zhyrnova --- - + # Commands for Linux Users In this chapter you will learn Linux commands and how to use them. @@ -12,13 +12,13 @@ In this chapter you will learn Linux commands and how to use them. **Objectives**: In this chapter, future Linux administrators will learn how to: -:heavy_check_mark: **Move** within the system tree. -:heavy_check_mark: **Create** a text file, **display** its contents and **modify** it. +:heavy_check_mark: **Move** within the system tree. +:heavy_check_mark: **Create** a text file, **display** its contents and **modify** it. :heavy_check_mark: **Use** the most useful Linux commands. :checkered_flag: **user commands**, **linux** -**Knowledge**: :star: +**Knowledge**: :star: **Complexity**: :star: **Reading time**: 40 minutes @@ -45,12 +45,15 @@ The user of a Linux system will be defined in the `/etc/passwd` file, by: * A numeric identifier: **UID** (User Identifier). * A group identifier: **GID** (Group Identifier). * A **command interpreter**, e.g., a shell, which can be different from one user to another. -* A **connection directory**, e.g., the __home directory__. +* A **connection directory**, e.g., the **home directory**. In other files the user will be defined by: * A **password**, which is encrypted before being stored (`/etc/shadow`). -* A **command prompt**, or __prompt__ login, which is symbolized by a `#` for administrators and a `$` for other users (`/etc/profile`). +* A **command prompt**, or **prompt** login, which is symbolized by a + + * `#` for administrators + * and a `$` for other users (`/etc/profile`). Depending on the security policy implemented on the system, the password will require a certain number of characters and meet certain complexity requirements. @@ -58,7 +61,7 @@ Among the existing command interpreters, the **Bourne-Again Shell** (`/bin/bash` The user's login directory is by convention stored in the `/home` directory of the workstation. It will contain the user's personal data and the configuration files of his applications. By default, at login, the login directory is selected as the current directory. -A workstation-type installation (with graphical interface) starts this interface on terminal 1. Linux being multi-user, it is possible to connect several users several times, on different **physical terminals** (TTY) or **virtual terminals** (PTS). Virtual terminals are available within a graphical environment. A user switches from one physical terminal to another using Alt + Fx from the command line or using CTRL + Alt + Fx. +A workstation-type installation (with graphical interface) starts this interface on terminal 1. Linux being multi-user, it is possible to connect several users several times, on different **physical terminals** (TTY) or **virtual terminals** (PTS). Virtual terminals are available within a graphical environment. A user switches from one physical terminal to another using ++alt+"Fx"++ from the command line or using ++ctrl+alt+"Fx"++. ### The shell @@ -72,7 +75,7 @@ Once the user is connected to a console, the shell displays the **command prompt * Displays the command prompt. * Etc. -The key sequence CTRL + C is used to interrupt a running command. +The key sequence ++ctrl+c++. is used to interrupt a running command. The use of a command generally follows this sequence: @@ -90,19 +93,19 @@ A double dash (`--`) indicates the end of the option list. It is possible to group some short options together: ```bash -$ ls -l -i -a +ls -l -i -a ``` is equivalent to: ```bash -$ ls -lia +ls -lia ``` There can be several arguments after an option: ```bash -$ ls -lia /etc /home /var +ls -lia /etc /home /var ``` In the literature, the term "option" is equivalent to the term "parameter," which is more commonly used in programming. The optional side of an option or argument is symbolized by enclosing it in square brackets `[` and `]`. When more than one option is possible, a vertical bar called a "pipe" separates them `[a|e|i]`. @@ -191,7 +194,7 @@ man passwd will tell the administrator about the passwd command, its options, etc. While a: ```bash -$ man 5 passwd +man 5 passwd ``` will inform him about the files related to the command. @@ -552,7 +555,7 @@ $ ls -lhR /var/ | grep ^\- | grep -E "[1-9]*\.[0-9]*M" Of course, we highly recommend that you use the `find` command. ```bash -$ find /var -size +1M -a -size -1024M -a -type f -exec ls -lh {} \; +find /var -size +1M -a -size -1024M -a -type f -exec ls -lh {} \; ``` * Show the rights on a folder: @@ -572,14 +575,14 @@ drwxr-xr-x. 2 root root 4096 17 nov. 17:48 alternatives The above command will display the contents of the folder (inside) by default. For the folder itself, you can use the `-d` option. ```bash -$ ls -ld /etc +ls -ld /etc drwxr-xr-x. 69 root root 4096 18 nov. 17:05 /etc ``` * Sort by file size, largest first: ```bash -$ ls -lhS +ls -lhS ``` * time/date format with `-l`: @@ -604,7 +607,7 @@ $ ls -dF /etc * Hide some extensions: ```bash -$ ls /etc --hide=*.conf +ls /etc --hide=*.conf ``` ### `mkdir` command @@ -618,7 +621,7 @@ mkdir [-p] directory [directory] [...] Example: ```bash -$ mkdir /home/rockstar/work +mkdir /home/rockstar/work ``` The "rockstar" directory must exist to create the "work" directory. @@ -640,7 +643,7 @@ touch [-t date] file Example: ```bash -$ touch /home/rockstar/myfile +touch /home/rockstar/myfile ``` | Option | Information | @@ -660,7 +663,7 @@ The `rmdir` command deletes an empty directory. Example: ```bash -$ rmdir /home/rockstar/work +rmdir /home/rockstar/work ``` | Option | Information | @@ -719,8 +722,9 @@ mv file [file ...] destination Examples: ```bash -$ mv /home/rockstar/file1 /home/rockstar/file2 -$ mv /home/rockstar/file1 /home/rockstar/file2 /tmp +mv /home/rockstar/file1 /home/rockstar/file2 + +mv /home/rockstar/file1 /home/rockstar/file2 /tmp ``` | Options | Information | @@ -731,37 +735,37 @@ $ mv /home/rockstar/file1 /home/rockstar/file2 /tmp A few concrete cases will help you understand the difficulties that can arise: ```bash -$ mv /home/rockstar/file1 /home/rockstar/file2 +mv /home/rockstar/file1 /home/rockstar/file2 ``` Renames `file1` to `file2`. If `file2` already exists, replace the contents of the file with `file1`. ```bash -$ mv /home/rockstar/file1 /home/rockstar/file2 /tmp +mv /home/rockstar/file1 /home/rockstar/file2 /tmp ``` Moves `file1` and `file2` into the `/tmp` directory. ```bash -$ mv file1 /repexist/file2 +mv file1 /repexist/file2 ``` Moves `file1` into `repexist` and renames it `file2`. ```bash -$ mv file1 file2 +mv file1 file2 ``` `file1` is renamed to `file2`. ```bash -$ mv file1 /repexist +mv file1 /repexist ``` If the destination directory exists, `file1` is moved to `/repexist`. ```bash -$ mv file1 /wrongrep +mv file1 /wrongrep ``` If the destination directory does not exist, `file1` is renamed to `wrongrep` in the root directory. @@ -777,7 +781,7 @@ cp file [file ...] destination Example: ```bash -$ cp -r /home/rockstar /tmp +cp -r /home/rockstar /tmp ``` | Options | Information | @@ -795,19 +799,19 @@ cp file1 /repexist/file2 `file1` is copied to `/repexist` under the name `file2`. ```bash -$ cp file1 file2 +cp file1 file2 ``` `file1` is copied as `file2` to this directory. ```bash -$ cp file1 /repexist +cp file1 /repexist ``` If the destination directory exists, `file1` is copied to `/repexist`. ```bash -$ cp file1 /wrongrep +cp file1 /wrongrep ``` If the destination directory does not exist, `file1` is copied under the name `wrongrep` to the root directory. @@ -880,19 +884,19 @@ cat file1 [files] Example 1 - Displaying the contents of a file to the standard output: ```bash -$ cat /etc/passwd +cat /etc/passwd ``` Example 2 - Displaying the contents of multiple files to standard output: ```bash -$ cat /etc/passwd /etc/group +cat /etc/passwd /etc/group ``` Example 3 - Combining the contents of multiple files into one file using output redirection: ```bash -$ cat /etc/passwd /etc/group > usersAndGroups.txt +cat /etc/passwd /etc/group > usersAndGroups.txt ``` Example 4 - Displaying the line numbering: @@ -1020,7 +1024,7 @@ Some advanced examples of using the `sort` command: The `sort` command also allows you to shuffle values with the `-R` option: ```bash -$ sort -R /etc/passwd +sort -R /etc/passwd ``` * Sorting IP addresses @@ -1029,7 +1033,7 @@ A system administrator is quickly confronted with the processing of IP addresses Here is an example with the file `dns-client.txt`: -``` +```text 192.168.1.10 192.168.1.200 5.1.150.146 @@ -1052,14 +1056,15 @@ The `sort` command knows how to remove the duplicates from the file output using Here is an example with the file `colours.txt`: -``` +```text Red Green Blue Red Pink ``` -``` + +```text $ sort -u colours.txt Blue Green @@ -1073,7 +1078,7 @@ The `sort` command knows how to recognize file sizes, from commands like `ls` wi Here is an example with the file `size.txt`: -``` +```text 1.7G 18M 69K @@ -1139,7 +1144,7 @@ If the search directory is not specified, the `find` command will search from th It is possible to use the `-exec` option of the `find` command to execute a command on each result line: ```bash -$ find /tmp -name *.txt -exec rm -f {} \; +find /tmp -name *.txt -exec rm -f {} \; ``` The previous command searches for all files in the `/tmp` directory named `*.txt` and deletes them. @@ -1205,12 +1210,13 @@ root:x:0:0:root:/root:/bin/bash | `-w` | Searches for the exact word. | The `grep` command returns the complete line containing the string you are looking for. + * The `^` special character is used to search for a string at the beginning of a line. * The special character `$` searches for a string at the end of a line. -```bash -$ grep -w "^root" /etc/passwd -``` + ```bash + grep -w "^root" /etc/passwd + ``` !!! Note @@ -1290,7 +1296,7 @@ These streams point to peripheral files, but since everything is a file in UNIX/ It is possible to redirect the input stream from another file with the character `<` or `<<`. The command will read the file instead of the keyboard: ```bash -$ ftp -in serverftp << ftp-commands.txt +ftp -in serverftp << ftp-commands.txt ``` !!! Note @@ -1343,13 +1349,13 @@ Standard output can be redirected to other files using the `>` or `>>` character The simple `>` redirection overwrites the contents of the output file: ```bash -$ date +%F > date_file +date +%F > date_file ``` When the `>>` character is used, it indicates that the output result of the command is appended to the file content. ```bash -$ date +%F >> date_file +date +%F >> date_file ``` In both cases, the file is automatically created when it does not exist. @@ -1357,8 +1363,9 @@ In both cases, the file is automatically created when it does not exist. The standard error output can also be redirected to another file. This time it will be necessary to specify the channel number (which can be omitted for channels 0 and 1): ```bash -$ ls -R / 2> errors_file -$ ls -R / 2>> errors_file +ls -R / 2> errors_file + +ls -R / 2>> errors_file ``` ### Examples of redirection @@ -1366,19 +1373,19 @@ $ ls -R / 2>> errors_file Redirection of 2 outputs to 2 files: ```bash -$ ls -R / >> ok_file 2>> nok_file +ls -R / >> ok_file 2>> nok_file ``` Redirection of the 2 outputs to a single file: ```bash -$ ls -R / >> log_file 2>&1 +ls -R / >> log_file 2>&1 ``` -Redirection of *stderr* to a "bottomless pit" (`/dev/null`): +Redirection of _stderr_ to a "bottomless pit" (`/dev/null`): ```bash -$ ls -R / 2>> /dev/null +ls -R / 2>> /dev/null ``` When both output streams are redirected, no information is displayed on the screen. To use both the output redirection and to keep the display, you will have to use the command `tee`. @@ -1400,31 +1407,31 @@ The commands particularly used after a pipe are filters. Display only the beginning: ```bash -$ ls -lia / | head +ls -lia / | head ``` Display only the end: ```bash -$ ls -lia / | tail +ls -lia / | tail ``` Sort the result: ```bash -$ ls -lia / | sort +ls -lia / | sort ``` Count the number of words / characters: ```bash -$ ls -lia / | wc +ls -lia / | wc ``` Search for a string in the result: ```bash -$ ls -lia / | grep fichier +ls -lia / | grep fichier ``` ## Special Points @@ -1436,8 +1443,9 @@ The `tee` command is used to redirect the standard output of a command to a file It is combined with the `|` pipe to receive as input the output of the command to be redirected: ```bash -$ ls -lia / | tee fic -$ cat fic +ls -lia / | tee fic + +cat fic ``` The `-a` option adds to the file instead of overwriting it. @@ -1449,13 +1457,13 @@ Using **alias** is a way to ask the shell to remember a particular command with For example: ```bash -$ ll +ll ``` will replace the command: ```bash -$ ls -l +ls -l ``` The `alias` command lists the aliases for the current session. Aliases are set by default on Linux distributions. Here, the aliases for a Rocky server: @@ -1489,13 +1497,13 @@ The `unalias` command allows you to delete aliases. To delete a single alias: ```bash -$ unalias ll +unalias ll ``` To delete all aliases: ```bash -$ unalias -a +unalias -a ``` To disable an alias temporarily, the combination is `\`. @@ -1503,7 +1511,7 @@ To disable an alias temporarily, the combination is `\`. For example if we do: ```bash -$ type ls +type ls ``` it might return the following: @@ -1591,7 +1599,7 @@ The `;` character strings the commands. The commands will all run sequentially in the order of input once the user presses ENTER. ```bash -$ ls /; cd /home; ls -lia; cd / +ls /; cd /home; ls -lia; cd / ``` ## Check your Knowledge @@ -1602,26 +1610,26 @@ $ ls /; cd /home; ls -lia; cd / :heavy_check_mark: Which commands allow you to search for help on a command? -- [ ] `google` -- [ ] `chuck --norris` -- [ ] `info` -- [ ] `apropos` -- [ ] `whatis` +* [ ] `google` +* [ ] `chuck --norris` +* [ ] `info` +* [ ] `apropos` +* [ ] `whatis` :heavy_check_mark: Which command allows you to view a user's history? :heavy_check_mark: Which command allows you to search for text in a file? -- [ ] `find` -- [ ] `grep` +* [ ] `find` +* [ ] `grep` :heavy_check_mark: Which command allows you to search for a file? -- [ ] `find` -- [ ] `grep` +* [ ] `find` +* [ ] `grep` :heavy_check_mark: Which command redirects the error stream of a command to a new `errors.log` file? -- [ ] `ls -R / 2> errors.log` -- [ ] `ls -R / 2>> errors.log` -- [ ] `ls -R / 2> errors.log 2>&1` +* [ ] `ls -R / 2> errors.log` +* [ ] `ls -R / 2>> errors.log` +* [ ] `ls -R / 2> errors.log 2>&1` From 46bd108d1520612ed752984c9f088935fae103ec Mon Sep 17 00:00:00 2001 From: Antoine Le Morvan Date: Sat, 30 Dec 2023 15:19:21 +0100 Subject: [PATCH 2/6] feat: add a markdownlint configuration file for the repository --- .markdownlint.yml | 269 ++++++++++++++++++++++ docs/books/admin_guide/00-toc.md | 1 - docs/books/admin_guide/01-presentation.md | 4 +- docs/books/admin_guide/03-commands.md | 2 +- 4 files changed, 271 insertions(+), 5 deletions(-) create mode 100644 .markdownlint.yml diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000000..47a0b9780a --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,269 @@ +# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml +# Example markdownlint configuration with all properties set to their default value + +# Default state for all rules +default: true + +# Path to configuration file to extend +extends: null + +# MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md001.md +MD001: true + +# MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md003.md +MD003: + # Heading style + style: "consistent" + +# MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md004.md +MD004: + # List style + style: "consistent" + +# MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md005.md +MD005: true + +# MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md007.md +MD007: + # Spaces for indent + indent: 4 + # Whether to indent the first level of the list + start_indented: false + # Spaces for first level indent (when start_indented is set) + start_indent: 2 + +# MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md009.md +MD009: + # Spaces for line break + br_spaces: 2 + # Allow spaces for empty lines in list items + list_item_empty_lines: false + # Include unnecessary breaks + strict: false + +# MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md010.md +MD010: + # Include code blocks + code_blocks: true + # Fenced code languages to ignore + ignore_code_languages: [] + # Number of spaces for each hard tab + spaces_per_tab: 1 + +# MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md011.md +MD011: true + +# MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md012.md +MD012: + # Consecutive blank lines + maximum: 1 + +# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md013.md +MD013: false + # Number of characters + # line_length: 80 + # Number of characters for headings + # heading_line_length: 80 + # Number of characters for code blocks + # code_block_line_length: 80 + # Include code blocks + # code_blocks: true + # Include tables + # tables: true + # Include headings + # headings: true + # Strict length checking + # strict: false + # Stern length checking + # stern: false + +# MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md014.md +MD014: true + +# MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md018.md +MD018: true + +# MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md019.md +MD019: true + +# MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md020.md +MD020: true + +# MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md021.md +MD021: true + +# MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md022.md +MD022: + # Blank lines above heading + lines_above: 1 + # Blank lines below heading + lines_below: 1 + +# MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md023.md +MD023: true + +# MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md024.md +MD024: + # Only check sibling headings + allow_different_nesting: false + # Only check sibling headings + siblings_only: false + +# MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md025.md +MD025: + # Heading level + level: 1 + # RegExp for matching title in front matter + #front_matter_title: "^\\s*title\\s*[:=]" + front_matter_title: "" + +# MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md026.md +MD026: + # Punctuation characters + punctuation: ".,;:!。,;:!" + +# MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md027.md +MD027: true + +# MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md028.md +MD028: true + +# MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md029.md +MD029: + # List style + style: "one_or_ordered" + +# MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md030.md +MD030: + # Spaces for single-line unordered list items + ul_single: 1 + # Spaces for single-line ordered list items + ol_single: 1 + # Spaces for multi-line unordered list items + ul_multi: 1 + # Spaces for multi-line ordered list items + ol_multi: 1 + +# MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md031.md +MD031: + # Include list items + list_items: true + +# MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md032.md +MD032: true + +# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md033.md +MD033: + # Allowed elements + allowed_elements: [] + +# MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md034.md +MD034: true + +# MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md035.md +MD035: + # Horizontal rule style + style: "consistent" + +# MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md036.md +MD036: + # Punctuation characters + punctuation: ".,;:!?。,;:!?" + +# MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md037.md +MD037: true + +# MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md038.md +MD038: true + +# MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md039.md +MD039: true + +# MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md040.md +MD040: + # List of languages + allowed_languages: [] + # Require language only + language_only: false + +# MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md041.md +MD041: + # Heading level + level: 1 + # RegExp for matching title in front matter + front_matter_title: "^\\s*title\\s*[:=]" + +# MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md042.md +MD042: true + +# MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md043.md +MD043: false + # List of headings + # headings: [] + # Match case of headings + # match_case: false + +# MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md044.md +MD044: + # List of proper names + names: [] + # Include code blocks + code_blocks: true + # Include HTML elements + html_elements: true + +# MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md045.md +MD045: true + +# MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md046.md +# Disabled for the use of admonitions +MD046: false + # Block style + # style: "consistent" + +# MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md047.md +MD047: true + +# MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md048.md +MD048: + # Code fence style + style: "consistent" + +# MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md049.md +MD049: + # Emphasis style + style: "consistent" + +# MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md050.md +MD050: + # Strong style + style: "consistent" + +# MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md051.md +MD051: true + +# MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md052.md +MD052: + # Include shortcut syntax + shortcut_syntax: false + +# MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md053.md +MD053: + # Ignored definitions + ignored_definitions: + - "//" + +# MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md054.md +MD054: + # Allow autolinks + autolink: true + # Allow inline links and images + inline: true + # Allow full reference links and images + full: true + # Allow collapsed reference links and images + collapsed: true + # Allow shortcut reference links and images + shortcut: true + # Allow URLs as inline links + url_inline: true diff --git a/docs/books/admin_guide/00-toc.md b/docs/books/admin_guide/00-toc.md index e283125647..4ef15146d9 100644 --- a/docs/books/admin_guide/00-toc.md +++ b/docs/books/admin_guide/00-toc.md @@ -1,7 +1,6 @@ --- title: Learning Linux With Rocky --- - # Learning Linux with Rocky diff --git a/docs/books/admin_guide/01-presentation.md b/docs/books/admin_guide/01-presentation.md index 56fb6ef155..c4b371f737 100644 --- a/docs/books/admin_guide/01-presentation.md +++ b/docs/books/admin_guide/01-presentation.md @@ -1,7 +1,6 @@ --- title: Introduction to Linux --- - # Introduction to the Linux Operating System @@ -19,8 +18,7 @@ In this chapter you will learn about GNU/Linux distributions. :checkered_flag: **generalities**, **linux**, **distributions** -**Knowledge**: :star: - +**Knowledge**: :star: **Complexity**: :star: **Reading time**: 10 minutes diff --git a/docs/books/admin_guide/03-commands.md b/docs/books/admin_guide/03-commands.md index aed32359e5..98f5289c25 100644 --- a/docs/books/admin_guide/03-commands.md +++ b/docs/books/admin_guide/03-commands.md @@ -3,7 +3,7 @@ title: Linux Commands author: Antoine Le Morvan contributors: Steven Spencer, Aditya Putta, tianci li, Grammaresque, Ganna Zhyrnova --- - + # Commands for Linux Users In this chapter you will learn Linux commands and how to use them. From 12177feea6e7b64bcd4736fe6ee35a20cf6413e1 Mon Sep 17 00:00:00 2001 From: Antoine Le Morvan Date: Sat, 30 Dec 2023 15:20:13 +0100 Subject: [PATCH 3/6] fix: review linter of advanced commands --- .../books/admin_guide/04-advanced-commands.md | 81 +++++++++---------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/docs/books/admin_guide/04-advanced-commands.md b/docs/books/admin_guide/04-advanced-commands.md index 850b2e6514..a5e41e0aa3 100644 --- a/docs/books/admin_guide/04-advanced-commands.md +++ b/docs/books/admin_guide/04-advanced-commands.md @@ -1,7 +1,6 @@ --- title: Advanced Linux Commands --- - # Advanced Commands for Linux users @@ -117,7 +116,7 @@ xargs use of xargs ``` -The `xargs` command waits for an input from the standard **stdin** input. Three lines are entered. The end of the user input is specified to `xargs` by the keystroke sequence CTRL+D. `xargs` then executes the default command `echo` followed by the three arguments corresponding to the user input, namely: +The `xargs` command waits for an input from the standard **stdin** input. Three lines are entered. The end of the user input is specified to `xargs` by the keystroke sequence ++ctrl+d++. `xargs` then executes the default command `echo` followed by the three arguments corresponding to the user input, namely: ```bash $ echo "use" "of" "xargs" @@ -221,51 +220,51 @@ The `yum-utils` package is a collection of utilities, built for `yum` by various While `yum` has been replaced by `dnf` in Rocky Linux 8, the package name has remained `yum-utils`, although it can be installed as `dnf-utils` as well. These are classic YUM utilities implemented as CLI shims on top of DNF to maintain backwards compatibility with `yum-3`. -Here are some examples of these utilities: +Here are some examples of these utilities. -* `repoquery` command +### `repoquery` command The `repoquery` command is used to query the packages in the repository. Examples of use: - * Display the dependencies of a package (it can be a software package that has been installed or not installed), equivalent to `dnf deplist ` - - ```bash - repoquery --requires - ``` - - * Display the files provided by an installed package (does not work for packages that are not installed), equivalent to `rpm -ql ` - - ```bash - $ repoquery -l yum-utils - /etc/bash_completion.d - /etc/bash_completion.d/yum-utils.bash - /usr/bin/debuginfo-install - /usr/bin/find-repos-of-install - /usr/bin/needs-restarting - /usr/bin/package-cleanup - /usr/bin/repo-graph - /usr/bin/repo-rss - /usr/bin/repoclosure - /usr/bin/repodiff - /usr/bin/repomanage - /usr/bin/repoquery - /usr/bin/reposync - /usr/bin/repotrack - /usr/bin/show-changed-rco - /usr/bin/show-installed - /usr/bin/verifytree - /usr/bin/yum-builddep - /usr/bin/yum-config-manager - /usr/bin/yum-debug-dump - /usr/bin/yum-debug-restore - /usr/bin/yum-groups-manager - /usr/bin/yumdownloader - … - ``` - -* `yumdownloader` command: +* Display the dependencies of a package (it can be a software package that has been installed or not installed), equivalent to `dnf deplist ` + +```bash +repoquery --requires +``` + +* Display the files provided by an installed package (does not work for packages that are not installed), equivalent to `rpm -ql ` + +```bash +$ repoquery -l yum-utils +/etc/bash_completion.d +/etc/bash_completion.d/yum-utils.bash +/usr/bin/debuginfo-install +/usr/bin/find-repos-of-install +/usr/bin/needs-restarting +/usr/bin/package-cleanup +/usr/bin/repo-graph +/usr/bin/repo-rss +/usr/bin/repoclosure +/usr/bin/repodiff +/usr/bin/repomanage +/usr/bin/repoquery +/usr/bin/reposync +/usr/bin/repotrack +/usr/bin/show-changed-rco +/usr/bin/show-installed +/usr/bin/verifytree +/usr/bin/yum-builddep +/usr/bin/yum-config-manager +/usr/bin/yum-debug-dump +/usr/bin/yum-debug-restore +/usr/bin/yum-groups-manager +/usr/bin/yumdownloader +… +``` + +### `yumdownloader` command The `yumdownloader` command downloads RPM packages from the repositories. Equivalent to `dnf download --downloadonly --downloaddir ./ package-name` From 90e03378373eb395a0df9c2b29dea0be7237b77e Mon Sep 17 00:00:00 2001 From: Antoine Le Morvan Date: Sat, 30 Dec 2023 15:20:39 +0100 Subject: [PATCH 4/6] fix: review linter of vi --- docs/books/admin_guide/05-vi.md | 42 ++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/books/admin_guide/05-vi.md b/docs/books/admin_guide/05-vi.md index ec68d9b116..1fb58fd854 100644 --- a/docs/books/admin_guide/05-vi.md +++ b/docs/books/admin_guide/05-vi.md @@ -10,13 +10,13 @@ In this chapter you will learn how to work with the VIsual editor. **Objectives**: In this chapter, future Linux administrators will learn how to: -:heavy_check_mark: Use the main commands of the VI editor; +:heavy_check_mark: Use the main commands of the VI editor; :heavy_check_mark: Modify a text with the VI editor. :checkered_flag: **user commands**, **linux** -**Knowledge**: :star: -**Complexity**: :star: :star: +**Knowledge**: :star: +**Complexity**: :star: :star: **Reading time**: 20 minutes @@ -36,14 +36,14 @@ Its functionalities are: The `vi` command opens the *VI* text editor. -``` +```bash vi [-c command] [file] ``` Example: -``` -$ vi /home/rockstar/file +```bash +vi /home/rockstar/file ``` | Option | Information | @@ -58,7 +58,7 @@ If the command `vi` is executed without specifying a file name, VI opens a blank The `vim` editor takes the interface and functions of VI with many improvements. -``` +```bash vim [-c command] [file] ``` @@ -78,9 +78,9 @@ At startup, VI is in *commands* mode. To exit VI, from the Commands mode, press : then type: -* `q` to exit without saving (_quit_); -* `w` to save your work (_write_); -* `wq` (_write quit_) or `x` (_eXit_) to save and exit. +* `q` to exit without saving (*quit*); +* `w` to save your work (*write*); +* `wq` (*write quit*) or `x` (*eXit*) to save and exit. In command mode, Click the Z key of uppercase status twice in a row to save and exit. @@ -210,11 +210,11 @@ VI switches to *insert* mode after entering one of these keys. * Inserting text before a character: -i (_insert_) +i (*insert*) * Inserting text after a character: -a (_append_) +a (*append*) ### In relation to a line @@ -292,7 +292,7 @@ These operations are done in *command* mode. * Replace one word: -cw_word_ESC +cw*word*ESC !!! Tip @@ -395,9 +395,9 @@ There are wildcards to facilitate the search in VI. Example: -`/[Ww]ord` : search _word_ or _Word_ +`/[Ww]ord` : search *word* or *Word* -`/[1-9]word` : search _1word_, _2word_ … _`x`word_ where `x` is a number +`/[1-9]word` : search *1word*, *2word* … *`x`word* where `x` is a number * `^` : Search for lines that begin with a characters. @@ -415,7 +415,7 @@ Example: Example: -`/W.rd` : search _Word_, _Ward_ … +`/W.rd` : search *Word*, *Ward* … * `*` : The number of times the previous character matches, 0 times, or any number of times. @@ -423,7 +423,7 @@ Example: `/W*d` -**Note:** If you want to ignore case (temporary) when matching strings, Please type the `:set ic`. +**Note:** If you want to ignore case (temporary) when matching strings, Please type the `:set ic`. ### Replace a string @@ -507,8 +507,8 @@ The **g** here stands for **global**. It is possible to execute VI by specifying the options to be loaded for the session. To do this, you must use the `-c` option: -``` -$ vi -c "set nu" /home/rockstar/file +```bash +vi -c "set nu" /home/rockstar/file ``` It is also possible to enter the *Ex* commands in a file named `.exrc` put in the user's login directory. At each VI or VIM startup, the commands will be read and applied. @@ -517,6 +517,6 @@ It is also possible to enter the *Ex* commands in a file named `.exrc` put in th There is a tutorial for learning how to use VI. It is accessible with the command `vimtutor`. -``` -$ vimtutor +```bash +vimtutor ``` From d2c278324415ca4232336707e8e797c28367da81 Mon Sep 17 00:00:00 2001 From: Antoine Le Morvan Date: Sat, 30 Dec 2023 15:21:26 +0100 Subject: [PATCH 5/6] fix: review linter and style (prompt style) of users chapter --- docs/books/admin_guide/06-users.md | 420 +++++++++++++++-------------- 1 file changed, 217 insertions(+), 203 deletions(-) diff --git a/docs/books/admin_guide/06-users.md b/docs/books/admin_guide/06-users.md index b33913a759..00f15257e1 100644 --- a/docs/books/admin_guide/06-users.md +++ b/docs/books/admin_guide/06-users.md @@ -9,16 +9,16 @@ In this chapter you will learn how to manage users. **** **Objectives**: In this chapter, future Linux administrators will learn how to: -:heavy_check_mark: add, delete or modify a **group**; -:heavy_check_mark: add, delete or modify a **user**; -:heavy_check_mark: understand the files associated with users and groups and learn how to manage them; -:heavy_check_mark: change the *owner* or the *group owner* of a file; -:heavy_check_mark: *secure* user accounts; +:heavy_check_mark: add, delete or modify a **group**; +:heavy_check_mark: add, delete or modify a **user**; +:heavy_check_mark: understand the files associated with users and groups and learn how to manage them; +:heavy_check_mark: change the *owner* or the *group owner* of a file; +:heavy_check_mark: *secure* user accounts; :heavy_check_mark: change identity. :checkered_flag: **users** -**Knowledge**: :star: :star: +**Knowledge**: :star: :star: **Complexity**: :star: :star: **Reading time**: 30 minutes @@ -38,8 +38,8 @@ Groups other than the primary group are called the user's **supplementary groups Groups and users are managed by their unique numerical identifiers `GID` and `UID`. -* `UID`: _User IDentifier_. Unique user ID. -* `GID`: _Group IDentifier_. Unique group identifier. +* `UID`: *User IDentifier*. Unique user ID. +* `GID`: *Group IDentifier*. Unique group identifier. Both UID and GID are recognized by the kernel, which means that the Super Admin is not necessarily the **root** user, as long as the **uid=0** user is the Super Admin. @@ -57,6 +57,12 @@ The files related to users/groups are: You should always use the administration commands instead of manually editing the files. +!!! Note + + Some commands in this chapter require administrator rights. + By convention, we will specify the command `sudo` when commands are to be run with administrator rights. + For the examples to work properly, please check that the account you're using has the right to use the `sudo` command. + ## Group management Modified files, added lines: @@ -67,21 +73,22 @@ Modified files, added lines: ### `groupadd` command The `groupadd` command adds a group to the system. -``` + +```bash groupadd [-f] [-g GID] group ``` Example: -``` -$ sudo groupadd -g 1012 GroupeB +```bash +sudo groupadd -g 1012 GroupeB ``` -| Option | Description | +| Option | Description | | --------| ----------------------------- | -|`-g GID` | Defines the `GID` of the group to create. | -|`-f` | The system chooses a `GID` if the one specified by the `-g` option already exists. | -|`-r` | Creates a system group with a `GID` between `SYS_GID_MIN` and `SYS_GID_MAX`. These two variables are defined in `/etc/login.defs`. | +|`-g GID` | Defines the `GID` of the group to create. | +|`-f` | The system chooses a `GID` if the one specified by the `-g` option already exists. | +|`-r` | Creates a system group with a `GID` between `SYS_GID_MIN` and `SYS_GID_MAX`. These two variables are defined in `/etc/login.defs`. | Group naming rules: @@ -105,42 +112,43 @@ Group naming rules: The `groupmod` command allows you to modify an existing group on the system. -``` +```bash groupmod [-g GID] [-n nom] group ``` Example: -``` -$ sudo groupmod -g 1016 GroupP -$ sudo groupmod -n GroupC GroupB +```bash +sudo groupmod -g 1016 GroupP + +sudo groupmod -n GroupC GroupB ``` -|Option | Description | +|Option | Description | | ------| ----------- | -|`-g GID` | New `GID` of the group to modify. +|`-g GID` | New `GID` of the group to modify. |`-n name` | New name. It is possible to change the name of a group, its `GID` or both simultaneously. After modification, the files belonging to the group have an unknown `GID`. They must be reassigned the new `GID`. -``` -$ sudo find / -gid 1002 -exec chgrp 1016 {} \; +```bash +sudo find / -gid 1002 -exec chgrp 1016 {} \; ``` ### `groupdel` command The `groupdel` command is used to delete an existing group on the system. -``` +```bash groupdel group ``` Example: -``` -$ sudo groupdel GroupC +```bash +sudo groupdel GroupC ``` !!! Tip @@ -153,17 +161,16 @@ $ sudo groupdel GroupC Examples: ```bash - Shell > useradd testa - Shell > id testa - uid=1000(testa) gid=1000(testa) group=1000(testa) - Shell > groupdel testa - groupdel: cannot remove the primary group of user 'testa' + $ sudo useradd test + $ id test + uid=1000(test) gid=1000(test) group=1000(test) + $ sudo groupdel test + groupdel: cannot remove the primary group of user 'test' - Shell > groupadd -g 1001 testb - Shell > usermod -G testb root - Shell > id root - uid=0(root) gid=0(root) group=0(root),1001(testb) - Shell > groupdel testb + $ sudo usermod -g users -G test test + $ id test + uid=1000(test) gid=100(users) group=100(users),1000(test) + $ sudo groupdel testb ``` !!! Tip @@ -205,7 +212,7 @@ $ sudo groupdel GroupC This file contains the group information (separated by `:`). -``` +```bash $ sudo tail -1 /etc/group GroupP:x:516:patrick (1) (2)(3) (4) @@ -224,7 +231,7 @@ GroupP:x:516:patrick This file contains the security information about the groups (separated by `:`). -``` +```bash $ sudo grep GroupA /etc/gshadow GroupA:$6$2,9,v...SBn160:alain:rockstar (1) (2) (3) (4) @@ -259,8 +266,8 @@ A user is defined as follows in the `/etc/passwd` file: There are three types of users: * **root(uid=0)**: the system administrator; -* **system users(uid is one of the 201~999)**: Used by the system to manage application access rights; -* **regular user(uid>=1000)**: Other account to log in to the system. +* **system users(uid is one of the 201~999)**: Used by the system to manage application access rights; +* **regular user(uid>=1000)**: Other account to log in to the system. Modified files, added lines: @@ -271,27 +278,27 @@ Modified files, added lines: The `useradd` command is used to add a user. -``` +```bash useradd [-u UID] [-g GID] [-d directory] [-s shell] login ``` Example: -``` -$ sudo useradd -u 1000 -g 1013 -d /home/GroupC/carine carine +```bash +sudo useradd -u 1000 -g 1013 -d /home/GroupC/carine carine ``` -| Option | Description | -| --------------| ------------------------------------------------------------------ | -|`-u UID` | `UID` of the user to create. | -|`-g GID` | `GID` of the primary group. The `GID` here can also be a `group name`. | -|`-G GID1,[GID2]...` | `GID` of the supplementary groups. The `GID` here can also be a `group name`. It is possible to specify many supplementary groups separated by commas. | -|`-d directory` | Creates the home directory. | -|`-s shell` | Specifies the user's shell. | -|`-c COMMENT` | Adds a comment. | +| Option | Description | +| --------------| ---------------------------------------------------------------------- | +|`-u UID` | `UID` of the user to create. | +|`-g GID` | `GID` of the primary group. The `GID` here can also be a `group name`. | +|`-G GID1,[GID2]...` | `GID` of the supplementary groups. The `GID` here can also be a `group name`. It is possible to specify many supplementary groups separated by commas. | +|`-d directory` | Creates the home directory. | +|`-s shell` | Specifies the user's shell. | +|`-c COMMENT` | Adds a comment. | |`-U` | Adds the user to a group with the same name created simultaneously. If not specified, creation of a group with the same name occurs when creating the user. | -|`-M` | Does not create the user's home directory. | -|`-r` | Creates a system account. | +|`-M` | Does not create the user's home directory. | +|`-r` | Creates a system account. | At creation, the account has no password and is locked. @@ -299,7 +306,7 @@ A password must be assigned to unlock the account. When invoking the `useradd` command without any options, the following default settings are set for the new user: -* A home directory with the same name as the username is created; +* A home directory with the same name as the username is created; * A primary group with the same name as the username is created; * A default shell that points to `/bin/bash` is assigned to the user; * The user's UID and primary group GID values are automatically deduced. This is usually a unique value between 1000 and 60,000. @@ -309,24 +316,24 @@ When invoking the `useradd` command without any options, the following default s The default settings and values are obtained from the following configuration files: `/etc/login.defs` and `/etc/default/useradd` - + ```bash -Shell > useradd test1 +$ sudo useradd test1 -Shell > tail -n 1 /etc/passwd +$ tail -n 1 /etc/passwd test1:x:1000:1000::/home/test1:/bin/bash -Shell > tail -n 1 /etc/shadow +$ tail -n 1 /etc/shadow test1:!!:19253:0:99999:7::: -Shell > tail -n 1 /etc/group ; tail -n 1 /etc/gshadow +$ tail -n 1 /etc/group ; tail -n 1 /etc/gshadow test1:x:1000: test1:!:: ``` Account naming rules: -* Lowercase letters, numbers and underscores are allowed, and other special characters such as asterisks, percent signs, full-width symbols are not accepted. +* Lowercase letters, numbers and underscores are allowed, and other special characters such as asterisks, percent signs, full-width symbols are not accepted. * Although you can use an uppercase user name in RockyLinux, we do not recommend it; * It is not recommended to start with numbers and underscores, although you may be allowed to do so; * Different from the name of an existing group or system file; @@ -342,8 +349,8 @@ The last directory is created by the `useradd` command, which takes the opportun Example: -``` -$ sudo useradd -u 1000 -g GroupA -G GroupP,GroupC albert +```bash +sudo useradd -u 1000 -g GroupA -G GroupP,GroupC albert ``` !!! Note @@ -357,46 +364,46 @@ $ sudo useradd -u 1000 -g GroupA -G GroupP,GroupC albert instead. ``` -#### Default value for user creation. +#### Default value for user creation Modification of the file `/etc/default/useradd`. -``` +```bash useradd -D [-b directory] [-g group] [-s shell] ``` Example: -``` -$ sudo useradd -D -g 1000 -b /home -s /bin/bash +```bash +sudo useradd -D -g 1000 -b /home -s /bin/bash ``` -| Option | Description | -| -------------- | ---------------------------------------------------------------------------- | -| `-D` | Sets the default values for user creation. | -| `-b directory` | Sets the default login directory. | -| `-g group` | Sets the default group. | -| `-s shell` | Sets the default shell. | -| `-f` | Sets the number of days after the password expires before disabling the account.| -| `-e` | Sets the date for disabling the account. | +| Option | Description | +| -------------- | -------------------------------------------------------------------------------- | +| `-D` | Sets the default values for user creation. | +| `-b directory` | Sets the default login directory. | +| `-g group` | Sets the default group. | +| `-s shell` | Sets the default shell. | +| `-f` | Sets the number of days after the password expires before disabling the account. | +| `-e` | Sets the date for disabling the account. | ### `usermod` command The `usermod` command allows to modify a user. -``` +```bash usermod [-u UID] [-g GID] [-d directory] [-m] login ``` Example: -``` -$ sudo usermod -u 1044 carine +```bash +sudo usermod -u 1044 carine ``` Options identical to the `useradd` command. -| Option | Description | +| Option | Description | | -------------- | --------------------------------------------------------------------------------------------- | |`-m` | Associated with the `-d` option. Moves the contents of the old login directory to the new one. If the old home directory does not exist, creation of a new home directory does not occur; Creation of the new home directory occurs when it does not exist.| |`-l login` | Modifies the login name. After you modify the login name, you also need to modify the name of the home directory to match it. | @@ -410,42 +417,43 @@ Options identical to the `useradd` command. To be modified, a user must be disconnected and have no running processes. -After changing the identifier, the files belonging to the user have an unknown `UID`. It must be reassigned to the new `UID`. +After changing the identifier, the files belonging to the user have an unknown `UID`. It must be reassigned to the new `UID`. Where `1000` is the old `UID` and `1044` is the new one. Examples are as follows: -``` -$ sudo find / -uid 1000 -exec chown 1044: {} \; +```bash +sudo find / -uid 1000 -exec chown 1044: {} \; ``` Locking and unlocking of user account, Examples are as follows: -``` -Shell > usermod -L test1 -Shell > grep test1 /etc/shadow +```bash +$ usermod -L test1 +$ grep test1 /etc/shadow test1:!$6$n.hxglA.X5r7X0ex$qCXeTx.kQVmqsPLeuvIQnNidnSHvFiD7bQTxU7PLUCmBOcPNd5meqX6AEKSQvCLtbkdNCn.re2ixYxOeGWVFI0:19259:0:99999:7::: -Shell > usermod -U test1 +$ usermod -U test1 ``` The difference between the `-aG` option and the `-G` option can be explained by the following example: ```bash -Shell > useradd test1 -Shell > passwd test1 -Shell > groupadd groupA ; groupadd groupB ; groupadd groupC ; groupadd groupD -Shell > id test1 +$ sudo useradd test1 +$ sudo passwd test1 +$ sudo groupadd groupA ; sudo groupadd groupB ; sudo groupadd groupC ; sudo groupadd groupD +$ id test1 uid=1000(test1) gid=1000(test1) groups=1000(test1) -Shell > gpasswd -a test1 groupA -Shell > id test1 +$ sudo gpasswd -a test1 groupA +$ id test1 uid=1000(test1) gid=1000(test1) groups=1000(test1),1002(groupA) -Shell > usermod -G groupB,groupC test1 -Shell > id test1 -uid=1000(test1) gid=1000(test1) gorups=1000(test1),1003(groupB),1004(groupC) +$ sudo usermod -G groupB,groupC test1 +$ id test1 +uid=1000(test1) gid=1000(test1) groups=1000(test1),1003(groupB),1004(groupC) -Shell > usermod -aG groupD test1 +$ sudo usermod -aG groupD test1 +$ id test1 uid=1000(test1) gid=1000(test1) groups=1000(test1),1003(groupB),1004(groupC),1005(groupD) ``` @@ -453,11 +461,11 @@ uid=1000(test1) gid=1000(test1) groups=1000(test1),1003(groupB),1004(groupC),100 The `userdel` command allows you to delete a user's account. -``` -$ sudo userdel -r carine +```bash +sudo userdel -r carine ``` -| Option | Description | +| Option | Description | | -------| --------------------------------------------------------- | | `-r` | Deletes the user's home directory and mail files located in the `/var/spool/mail/` directory | @@ -465,13 +473,13 @@ $ sudo userdel -r carine To be deleted, a user must be logged out and have no running processes. -The `userdel` command removes the corresponding lines in `/etc/passwd`, `/ etc/shadow`, `/etc/group`, `/etc/gshadow`. As mentioned above, `userdel -r` will also delete the corresponding primary group of the user. +The `userdel` command removes the corresponding lines in `/etc/passwd`, `/ etc/shadow`, `/etc/group`, `/etc/gshadow`. As mentioned above, `userdel -r` will also delete the corresponding primary group of the user. ### `/etc/passwd` file This file contains user information (separated by `:`). -``` +```bash $ sudo head -1 /etc/passwd root:x:0:0:root:/root:/bin/bash (1)(2)(3)(4)(5) (6) (7) @@ -488,21 +496,22 @@ root:x:0:0:root:/root:/bin/bash ### `/etc/shadow` file This file contains the users' security information (separated by `:`). -``` + +```bash $ sudo tail -1 /etc/shadow root:$6$...:15399:0:99999:7::: (1) (2) (3) (4) (5) (6)(7,8,9) ``` -* 1: Login name. +* 1: Login name. * 2: Encrypted password. Uses the SHA512 encryption algorithm, defined by the `ENCRYPT_METHOD` of `/etc/login.defs`. -* 3: The time when the password was last changed, the timestamp format, in days. The so-called timestamp is based on January 1, 1970 as the standard time. Every time one day goes by, the timestamp is +1. +* 3: The time when the password was last changed, the timestamp format, in days. The so-called timestamp is based on January 1, 1970 as the standard time. Every time one day goes by, the timestamp is +1. * 4: Minimum lifetime of the password. That is, the time interval between two password changes (related to the third field), in days. Defined by the `PASS_MIN_DAYS` of `/etc/login.defs`, the default is 0, that is, when you change the password for the second time, there is no restriction. However, if it is 5, it means that it is not allowed to change the password within 5 days, and only after 5 days. * 5: Maximum lifetime of the password. That is, the validity period of the password (related to the third field). Defined by the `PASS_MAX_DAYS` of `/etc/login.defs`. * 6: The number of warning days before the password expires (related to the fifth field). The default is 7 days, defined by the `PASS_WARN_AGE` of `/etc/login.defs`. * 7: Number of days of grace after password expiration (related to the fifth field). * 8: Account expiration time, the timestamp format, in days. **Note that an account expiration differs from a password expiration. In case of an account expiration, the user shall not be allowed to login. In case of a password expiration, the user is not allowed to login using her password.** -* 9: Reserved for future use. +* 9: Reserved for future use. !!! Danger @@ -512,10 +521,10 @@ For time stamp and date conversion, please refer to the following command format ```bash # The timestamp is converted to a date, "17718" indicates the timestamp to be filled in. -Shell > date -d "1970-01-01 17718 days" +$ date -d "1970-01-01 17718 days" # The date is converted to a timestamp, "2018-07-06" indicates the date to be filled in. -Shell > echo $(($(date --date="2018-07-06" +%s)/86400+1)) +$ echo $(($(date --date="2018-07-06" +%s)/86400+1)) ``` ## File owners @@ -531,62 +540,66 @@ The primary group of the user creating the file is, by default, the group that o #### `chown` command The `chown` command allows you to change the owners of a file. -``` + +```bash chown [-R] [-v] login[:group] file ``` Examples: -``` -$ sudo chown root myfile -$ sudo chown albert:GroupA myfile + +```bash +sudo chown root myfile + +sudo chown albert:GroupA myfile ``` -| Option | Description | -| ------ | ------------------------------------------------------ | -| `-R` | Recursively changes the owners of the directory and all files under the directory.| -| `-v` | Displays the changes. | +| Option | Description | +| ------ | ---------------------------------------------------------------------------------- | +| `-R` | Recursively changes the owners of the directory and all files under the directory. | +| `-v` | Displays the changes. | To change only the owner user: -``` -$ sudo chown albert file +```bash +sudo chown albert file ``` To modify only the owner group: -``` -$ sudo chown :GroupA file +```bash +sudo chown :GroupA file ``` Changing the user and owner group: -``` -$ sudo chown albert:GroupA file +```bash +sudo chown albert:GroupA file ``` In the following example the group assigned will be the primary group of the specified user. -``` -$ sudo chown albert: file +```bash +sudo chown albert: file ``` Change the owner and group of all files in a directory -``` -$ sudo chown -R albert:GroupA /dir1 +```bash +sudo chown -R albert:GroupA /dir1 ``` ### `chgrp` command The `chgrp` command allows you to change the owner group of a file. -``` +```bash chgrp [-R] [-v] group file ``` Example: -``` -$ sudo chgrp group1 file + +```bash +sudo chgrp group1 file ``` | Option | Description | @@ -598,13 +611,13 @@ $ sudo chgrp group1 file It is possible to apply to a file an owner and an owner group by taking as reference those of another file: -``` +```bash chown [options] --reference=RRFILE FILE ``` For example: -``` +```bash chown --reference=/etc/groups /etc/passwd ``` @@ -614,27 +627,27 @@ chown --reference=/etc/groups /etc/passwd The command `gpasswd` allows to manage a group. -``` +```bash gpasswd [option] group ``` Examples: -``` +```bash $ sudo gpasswd -A alain GroupA [alain]$ gpasswd -a patrick GroupA ``` -| Option | Description | -| ---------- | ------------------------------------ | +| Option | Description | +| ---------- | ------------------------------------------------------------------------------------ | | `-a USER` | Adds the user to the group. For the added user, this group is a supplementary group. | -| `-A USER,...` | Sets the list of administrative users. | -| `-d USER` | Removes the user from the group. | -| `-M USER,...` | Sets the list of group members.| +| `-A USER,...` | Sets the list of administrative users. | +| `-d USER` | Removes the user from the group. | +| `-M USER,...` | Sets the list of group members. | The command `gpasswd -M` acts as a modification, not an addition. -``` +```bash # gpasswd GroupeA New Password: Re-enter new password: @@ -648,60 +661,60 @@ Re-enter new password: The `id` command displays the group names of a user. -``` +```bash id USER ``` Example: -``` +```bash $ sudo id alain uid=1000(alain) gid=1000(GroupA) groupes=1000(GroupA),1016(GroupP) ``` ### `newgrp` command -The `newgrp` command can select a group from the user's supplementary groups as the user's new **temporary** primary group. The `newgrp` command every time you switch a user's primary group, there will be a new **child shell**(child process). Be careful! **child shell** and **sub shell** are different. +The `newgrp` command can select a group from the user's supplementary groups as the user's new **temporary** primary group. The `newgrp` command every time you switch a user's primary group, there will be a new **child shell**(child process). Be careful! **child shell** and **sub shell** are different. -``` +```bash newgrp [secondarygroups] ``` Example: -``` -Shell > useradd test1 -Shell > passwd test1 -Shell > groupadd groupA ; groupadd groupB -Shell > usermod -G groupA,groupB test1 -Shell > id test1 +```bash +$ sudo useradd test1 +$ sudo passwd test1 +$ sudo groupadd groupA ; sudo groupadd groupB +$ sudo usermod -G groupA,groupB test1 +$ id test1 uid=1000(test1) gid=1000(test1) groups=1000(test1),1001(groupA),1002(groupB) -Shell > echo $SHLVL ; echo $BASH_SUBSHELL +$ echo $SHLVL ; echo $BASH_SUBSHELL 1 0 -Shell > su - test1 -Shell > touch a.txt -Shell > ll +$ su - test1 +$ touch a.txt +$ ll -rw-rw-r-- 1 test1 test1 0 10月 7 14:02 a.txt -Shell > echo $SHLVL ; echo $BASH_SUBSHELL +$ echo $SHLVL ; echo $BASH_SUBSHELL 1 0 # Generate a new child shell -Shell > newgrp groupA -Shell > touch b.txt -Shell > ll +$ newgrp groupA +$ touch b.txt +$ ll -rw-rw-r-- 1 test1 test1 0 10月 7 14:02 a.txt -rw-r--r-- 1 test1 groupA 0 10月 7 14:02 b.txt -Shell > echo $SHLVL ; echo $BASH_SUBSHELL +$ echo $SHLVL ; echo $BASH_SUBSHELL 2 0 # You can exit the child shell using the `exit` command -Shell > exit -Shell > logout -Shell > whoami +$ exit +$ logout +$ whoami root ``` @@ -711,15 +724,16 @@ root The `passwd` command is used to manage a password. -``` +```bash passwd [-d] [-l] [-S] [-u] [login] ``` Examples: -``` -Shell > passwd -l albert -Shell > passwd -n 60 -x 90 -w 80 -i 10 patrick +```bash +sudo passwd -l albert + +sudo passwd -n 60 -x 90 -w 80 -i 10 patrick ``` | Option | Description | @@ -740,14 +754,14 @@ Example: * Alain changes his password: -``` +```bash [alain]$ passwd ``` * root changes Alain's password -``` -$ sudo passwd alain +```bash +sudo passwd alain ``` !!! Note @@ -762,8 +776,8 @@ This can be done by passing the password to the `passwd` command. Example: -``` -$ sudo echo "azerty,1" | passwd --stdin philippe +```bash +sudo echo "azerty,1" | passwd --stdin philippe ``` !!! Warning @@ -774,14 +788,14 @@ $ sudo echo "azerty,1" | passwd --stdin philippe The `chage` command is change user password expiry information. -``` +```bash chage [-d date] [-E date] [-I days] [-l] [-m days] [-M days] [-W days] [login] ``` Example: -``` -$ sudo chage -m 60 -M 90 -W 80 -I 10 alain +```bash +sudo chage -m 60 -M 90 -W 80 -I 10 alain ``` | Option | Description | @@ -796,7 +810,7 @@ $ sudo chage -m 60 -M 90 -W 80 -I 10 alain Examples: -``` +```bash # The `chage` command also offers an interactive mode. $ sudo chage philippe @@ -830,7 +844,7 @@ This file contains the default data settings. This file is modified by the command `useradd -D` (`useradd -D` entered without any other option displays the contents of the `/etc/default/useradd` file). -``` +```bash Shell > grep -v ^# /etc/default/useradd GROUP=100 HOME=/home @@ -841,19 +855,19 @@ SKEL=/etc/skel CREATE_MAIL_SPOOL=yes ``` -| Parameters | Comment | -| ---------- | ------------------------------------------------------------------------ | -| `GROUP` | Defines the default primary group GID. | -| `HOME` | Defines the directory path of the upper level of the common user's home directory. | +| Parameters | Comment | +| ---------- | ---------------------------------------------------------------------------------- | +| `GROUP` | Defines the default primary group GID. | +| `HOME` | Defines the directory path of the upper level of the common user's home directory. | | `INACTIVE` | Defines the number of days of grace after password expiration. Corresponds to the 7th field of the `/etc/shadow` file. `-1` value means that the grace period feature is turned off.| | `EXPIRE` | Defines the account expiration date. Corresponds to the 8th field of the `/etc/shadow` file. | -| `SHELL` | Defines the command interpreter. | -| `SKEL` | Defines the skeleton directory of the login directory. | -| `CREATE_MAIL_SPOOL` | Defines the mailbox creation in `/var/spool/mail/`. | +| `SHELL` | Defines the command interpreter. | +| `SKEL` | Defines the skeleton directory of the login directory. | +| `CREATE_MAIL_SPOOL` | Defines the mailbox creation in `/var/spool/mail/`. | If you do not need a primary group with the same name when creating users, you can do this: -``` +```bash Shell > useradd -N test2 Shell > id test2 uid=1001(test2) gid=100(users) groups=100(users) @@ -886,7 +900,7 @@ ENCRYPT_METHOD SHA512 `UMASK 022`: This means that the permission to create a file is 755 (rwxr-xr-x). However, for the sake of security, GNU/Linux does not have **x** permission for newly created files, this restriction applies to root(uid=0) and ordinary users(uid>=1000). For example: -``` +```bash Shell > touch a.txt Shell > ll -rw-r--r-- 1 root root 0 Oct 8 13:00 a.txt @@ -894,7 +908,7 @@ Shell > ll `HOME_MODE 0700`: The permissions of an ordinary user's home directory. Does not work for root's home directory. -``` +```bash Shell > ll -d /root dr-xr-x---. 10 root root 4096 Oct 8 13:12 /root @@ -922,21 +936,21 @@ All files and directories placed in this directory will be copied to the user tr The `su` command allows you to change the identity of the connected user. -``` +```bash su [-] [-c command] [login] ``` Examples: -``` +```bash $ sudo su - alain [albert]$ su - root -c "passwd alain" ``` -| Option | Description | -| ------ | ----------------------------------------------------- | -| `-` | Loads the user's complete environment. | -| `-c` command | Executes the command under the user's identity.| +| Option | Description | +| ------------ | ------------------------------------------------| +| `-` | Loads the user's complete environment. | +| `-c` command | Executes the command under the user's identity. | If the login is not specified, it will be `root`. @@ -947,28 +961,28 @@ Standard users will have to type the password for the new identity. You can use the `exit`/`logout` command to exit users who have been switched. It should be noted that after switching users, there is no new `child shell` or `sub shell`, for example: ``` - Shell > whoami + $ whoami root - Shell > echo $SHLVL ; echo $BASH_SUBSHELL + $ echo $SHLVL ; echo $BASH_SUBSHELL 1 0 - Shell > su - test1 - Shell > echo $SHLVL ; echo $BASH_SUBSHELL + $ su - test1 + $ echo $SHLVL ; echo $BASH_SUBSHELL 1 0 ``` Attention please! `su` and `su -` are different, as shown in the following example: -``` -Shell > whoami +```bash +$ whoami test1 -Shell > su root -Shell > pwd +$ su root +$ pwd /home/test1 -Shell > env +$ env ... USER=test1 PWD=/home/test1 @@ -978,14 +992,14 @@ LOGNAME=test1 ... ``` -``` -Shell > whoami +```bash +$ whoami test1 -Shell > su - root -Shell > pwd +$ su - root +$ pwd /root -Shell > env +$ env ... USER=root PWD=/root From 70c299c3ad9685d4b5d166b8adfd33335b5ccb8a Mon Sep 17 00:00:00 2001 From: sspencerwire Date: Fri, 29 Dec 2023 10:53:46 -0600 Subject: [PATCH 6/6] # Update `rockydocs_formatting.md` keyboard section (#1634) * Remove the references of key and replace with the markdown equivalent ++key++ * provide a link to the available key section --- .../guides/contribute/rockydocs_formatting.md | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/guides/contribute/rockydocs_formatting.md b/docs/guides/contribute/rockydocs_formatting.md index 4eb0569d8a..a0b8fe4fa0 100644 --- a/docs/guides/contribute/rockydocs_formatting.md +++ b/docs/guides/contribute/rockydocs_formatting.md @@ -251,13 +251,13 @@ That ends up looking like this when the page displays: ## Inline and block-level code blocks -Our approach to the use of code blocks is pretty simple. If `your code` is short enough that you can (and want to) use it in a sentence like you just saw, use single backticks `: +Our approach to the use of code blocks is pretty simple. If `your code` is short enough that you can (and want to) use it in a sentence like you just saw, use single backticks ++"`"++: ``` A sentence with a `command of your choosing` in it. ``` -Any command that is not used inside of a text paragraph (especially the long bits of code with multiple lines) should be a full code block, defined with triple backticks `: +Any command that is not used inside of a text paragraph (especially the long bits of code with multiple lines) should be a full code block, defined with triple backticks ++"```"++: ````markdown ```bash @@ -267,7 +267,7 @@ sudo dnf install the-kitchen-sink The `bash` bit of that formatting is a non-essential code identifier but can help with syntax highlighting. If you showcase Python, PHP, Ruby, HTML, CSS, or any other kind of code, the "bash" will change to whatever language you use. -Incidentally, if you need to show a code block within a code block, just add one more backtick ` to the parent block: +Incidentally, if you need to show a code block within a code block, just add one more backtick ++"`"++ to the parent block: `````markdown ````markdown @@ -297,15 +297,21 @@ When using this method, the automatic line feed is also suppressed. ## Keyboard -Another way to add as much clarity to your documents as possible is to represent the entering of keys on a keyboard in the correct manner. Do this with `key`. For instance, to represent that you need to hit the escape key in your document you would use `ESCCTRL + F4`. If requiring the pressing of keys simultaneously, add "simultaneously" or "at the same time" or some similar phrase to your instructions. Here is an example of a keyboard instruction in your editor: +Another way to add as much clarity to your documents as possible is to represent the entering of keys on a keyboard in the correct manner. In markdown, do this by surrounding the key or keys with double plus signs (`++`) Do this with `++key++`. For instance, to represent that you need to hit the escape key in your document you would use `++escape++`. When you need to indicate the pressing of multiple keys, add a `+` between them like this: `++ctrl+f4++`. For keys that aren't defined (for instance we are indicating a mystery function key, `Fx` below) put your definition in quotes (`++ctrl+"Fx"++`). If requiring the pressing of keys simultaneously, add "simultaneously" or "at the same time" or some similar phrase to your instructions. Here is an example of a keyboard instruction in your editor: ``` -A workstation type installation (with graphical interface) starts this interface on terminal 1. Linux being multi-user, it is possible to connect several users several times, on different **physical terminals** (TTY) or **virtual terminals** (PTS). Virtual terminals are available within a graphical environment. A user switches from one physical terminal to another using Alt + Fx from the command line or using CTRL + Alt + Fx. +A workstation type installation (with graphical interface) starts this interface on terminal 1. Linux being multi-user, it is possible to connect several users several times, on different **physical terminals** (TTY) or **virtual terminals** (PTS). Virtual terminals are available within a graphical environment. A user switches from one physical terminal to another using ++alt+"Fx"++ from the command line or using ++ctrl+alt+"Fx"++. ``` Here is how that renders when displayed: -A workstation type installation (with graphical interface) starts this interface on terminal 1. Linux being multi-user, it is possible to connect several users several times, on different **physical terminals** (TTY) or **virtual terminals** (PTS). Virtual terminals are available within a graphical environment. A user switches from one physical terminal to another using Alt + Fx from the command line or using CTRL + Alt + Fx. +A workstation type installation (with graphical interface) starts this interface on terminal 1. Linux being multi-user, it is possible to connect several users several times, on different **physical terminals** (TTY) or **virtual terminals** (PTS). Virtual terminals are available within a graphical environment. A user switches from one physical terminal to another using ++alt+"Fx"++ from the command line or using ++ctrl+alt+"Fx"++. + +A list of accepted keyboard commands [in this document](https://facelessuser.github.io/pymdown-extensions/extensions/keys/#key-map-index). + +!!! note + + These keyboard shortcuts are always entered in lower case except where a custom keyboard command is used within the quotes. ## Superscript, subscript and special symbols @@ -382,7 +388,7 @@ Or you may have a numbered list, with an additional admonition: Here you are adding a keyboard command to the list item: - Press ESC for no particular reason. + Press ++escape++ for no particular reason. 2. But this item is something very important *and* has multiple paragraphs to it