Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:rhel:6:utilisateur:l104 [2020/01/30 03:28] – external edit 127.0.0.1 | elearning:workbooks:rhel:6:utilisateur:l104 [2023/05/10 16:21] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ~~PDF: | ||
- | Last updated on: ~~LASTMOD~~ | + | Version |
- | ======Basic Shell Commands and Text Manipulation Tools====== | + | Last updated : ~~LASTMOD~~ |
- | <WRAP center round important | + | ======LCE404 - Basic Shell Commands and Text Manipulation Tools====== |
+ | |||
+ | =====Contents===== | ||
+ | |||
+ | * **LCE404 - Basic Shell Commands and Text Manipulation Tools** | ||
+ | * Contents | ||
+ | * LAB #1 - Use of Basic Shell Commands | ||
+ | * 1.1 - The stty Command | ||
+ | * 1.2 - The date command | ||
+ | * 1.3 - The who Command | ||
+ | * 1.4 - The df Command | ||
+ | * 1.5 - The free Command | ||
+ | * 1.6 - The whoami Command | ||
+ | * 1.7 - The pwd Command | ||
+ | * 1.8 - The cd Command | ||
+ | * 1.9 - The ls Command | ||
+ | * 1.10 - The lsof Command | ||
+ | * 1.11 - The touch Command | ||
+ | * 1.12 - The echo Command | ||
+ | * 1.13 - The cp Command | ||
+ | * 1.14 - The file Command | ||
+ | * 1.15 - The cat Command | ||
+ | * 1.16 - The mv Command | ||
+ | * 1.17 - The mkdir Command | ||
+ | * 1.18 - The rmdir Command | ||
+ | * 1.19 - The rm Command | ||
+ | * 1.20 - The sort Command | ||
+ | * 1.21 - The more Command | ||
+ | * 1.22 - The less Command | ||
+ | * 1.23 - The find Command | ||
+ | * 1.24 - The su Command | ||
+ | * 1.25 - The updatedb and locate Commands | ||
+ | * 1.26 - The whereis Command | ||
+ | * 1.27 - The which Command | ||
+ | * 1.28 - The uptime Command | ||
+ | * 1.29 - The w Command | ||
+ | * 1.30 - The uname Command | ||
+ | * 1.31 - The du Command | ||
+ | * 1.32 - The clear Command | ||
+ | * 1.33 - The exit Command | ||
+ | * 1.34 - The logout Command | ||
+ | * 1.35 - The sleep Command | ||
+ | * 1.36 - The wall Command | ||
+ | * 1.37 - The seq Command | ||
+ | * 1.38 - The screen Command | ||
+ | * LAB #2 - Switches and Arguments | ||
+ | * LAB #3 - Regular Expressions | ||
+ | * BREs | ||
+ | * EREs | ||
+ | * Manipulating Text Files | ||
+ | * Text-search Utilities | ||
+ | * The grep Command | ||
+ | * The egrep Command | ||
+ | * The fgrep Command | ||
+ | * LAB #4 - Using grep, egrep and fgrep | ||
+ | * The Stream EDitor SED | ||
+ | * LAB #5 - Using sed | ||
+ | * The Text Processor AWK | ||
+ | * Presentation | ||
+ | * Field Separation | ||
+ | * Conditions | ||
+ | * A regular expression applied to a record | ||
+ | * A regular expression applied to a field | ||
+ | * Comparisons | ||
+ | * Logical Operators | ||
+ | * Built-in Variables | ||
+ | * Awk Scripts | ||
+ | * The printf function | ||
+ | * Control Statements | ||
+ | * if | ||
+ | * for | ||
+ | * while | ||
+ | * do-while | ||
+ | * LAB #3 - Using awk | ||
+ | * LAB 7 - Other Useful Commands | ||
+ | * 7.1 - The expand Command | ||
+ | * 7.2 - La Commande unexpand | ||
+ | * 7.3 - The cut command | ||
+ | * 7.4 - The uniq Command | ||
+ | * 7.5 - The tr Command | ||
+ | * 7.6 - The paste Command | ||
+ | * 7.7 - The split Command | ||
+ | * 7.8 - The diff Command | ||
+ | * 7.9 - The cmp Command | ||
+ | * 7.10 - The patch Command | ||
+ | * 7.11 - The strings Command | ||
+ | * 7.12 - The comm Command | ||
+ | * 7.13 - The head Command | ||
+ | * 7.14 - The tail Command | ||
+ | * LAB #8 - Use the grep, tr and cut commands to extract your IPv4 address from the output of ifconfig | ||
+ | * LAB #9 - Use the grep, awk and sed commands to extract your IPv4 address from the output of ip | ||
+ | |||
+ | =====LAB #1 - Use of Basic Shell Commands===== | ||
+ | |||
+ | <WRAP center round todo 60%> | ||
**To do** - You are currently the root user in your terminal. Before proceeding further, type **exit** and hit the < | **To do** - You are currently the root user in your terminal. Before proceeding further, type **exit** and hit the < | ||
</ | </ | ||
- | =====Use of Basic Shell Commands===== | + | ====1.1 - The stty Command==== |
- | + | ||
- | ====The stty Command==== | + | |
Using this command with the **-a** switch allows you to identify which combination of keys should be used to control a foreground process: | Using this command with the **-a** switch allows you to identify which combination of keys should be used to control a foreground process: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | speed 38400 baud; rows 26; columns 80; line = 0; | + | speed 38400 baud; rows 24; columns 80; line = 0; |
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = < | intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = < | ||
eol2 = < | eol2 = < | ||
- | werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; | + | werase = ^W; lnext = ^V; discard |
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts | -parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts | ||
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff | -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff | ||
- | -iuclc -ixany -imaxbel | + | -iuclc -ixany -imaxbel iutf8 |
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 | opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 | ||
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt | isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt | ||
- | echoctl echoke | + | echoctl echoke |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | The two most important combinations are **intr = ^C** and **susp = ^Z**. The former kills the process whilst the latter suspends its execution. | + | **Important** - The two most important combinations are **intr = ^C** and **susp = ^Z**. The former kills the process whilst the latter suspends its execution. |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **stty** command to view the command line switches. | **To do** : Use the **--help** option of the **stty** command to view the command line switches. | ||
</ | </ | ||
- | ====The date command==== | + | ====1.2 - The date command==== |
This command' | This command' | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | Thu 29 Sep 04:53:58 CEST 2016 | + | Tue 20 Apr 02:27:55 EDT 2021 |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **date** command to view the command line switches. | **To do** : Use the **--help** option of the **date** command to view the command line switches. | ||
</ | </ | ||
- | ====The who Command==== | + | ====1.3 - The who Command==== |
This command' | This command' | ||
< | < | ||
- | [trainee@centos7 | + | < |
- | trainee | + | [trainee@centos8 |
+ | trainee | ||
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **who** command to view the command line switches. | **To do** : Use the **--help** option of the **who** command to view the command line switches. | ||
</ | </ | ||
- | ====The df Command==== | + | ====1.4 - The df Command==== |
This command' | This command' | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
Filesystem | Filesystem | ||
- | / | + | devtmpfs |
- | devtmpfs | + | tmpfs |
- | tmpfs 250388 | + | tmpfs |
- | tmpfs 250388 | + | tmpfs |
- | tmpfs 250388 | + | / |
- | tmpfs | + | / |
- | / | + | tmpfs 382740 |
- | tmpfs | + | |
</ | </ | ||
Ligne 89: | Ligne 180: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
Filesystem | Filesystem | ||
- | / | + | devtmpfs |
- | devtmpfs | + | tmpfs 1.9G 0 |
- | tmpfs 245M 0 | + | tmpfs 1.9G 8.6M 1.9G |
- | tmpfs 245M 4.7M 240M | + | tmpfs 1.9G 0 |
- | tmpfs 245M 0 | + | / |
- | tmpfs | + | / |
- | / | + | tmpfs 374M 0 |
- | tmpfs | + | |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **df** command to view the command line switches. | **To do** : Use the **--help** option of the **df** command to view the command line switches. | ||
</ | </ | ||
- | ====The free Command==== | + | ====1.5 - The free Command==== |
This command' | This command' | ||
- | < | + | [trainee@centos8 |
- | [trainee@centos7 | + | |
total used free shared | total used free shared | ||
- | Mem: 500780 | + | Mem: |
- | Swap: 2096124 | + | Swap: 2047996 |
</ | </ | ||
Ligne 121: | Ligne 210: | ||
< | < | ||
- | [trainee@centos7 | + | < |
+ | [trainee@centos8 | ||
total used free shared | total used free shared | ||
- | Mem: 489M 188M | + | Mem: 3.6Gi |
- | Swap: 2.0G 3.8M | + | Swap: |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **free** command to view the command line switches. | **To do** : Use the **--help** option of the **free** command to view the command line switches. | ||
</ | </ | ||
- | ====The whoami Command==== | + | ====1.6 - The whoami Command==== |
This command' | This command' | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
trainee | trainee | ||
</ | </ | ||
Ligne 145: | Ligne 235: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
Password: fenestros | Password: fenestros | ||
- | Last login: Wed Sep 28 12:08:28 CEST 2016 on pts/0 | ||
</ | </ | ||
Ligne 157: | Ligne 246: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
root | root | ||
- | [root@centos7 ~]# | ||
</ | </ | ||
Ligne 169: | Ligne 257: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
logout | logout | ||
- | [trainee@centos7 | + | [trainee@centos8 |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **whoami** command to view the command line switches. | **To do** : Use the **--help** option of the **whoami** command to view the command line switches. | ||
</ | </ | ||
- | ====The pwd Command==== | + | ====1.7 - The pwd Command==== |
This command' | This command' | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
/ | / | ||
</ | </ | ||
Ligne 191: | Ligne 279: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **help** command with **pwd** option to view the command line switches. | **To do** : Use the **help** command with **pwd** option to view the command line switches. | ||
</ | </ | ||
- | ====The cd Command=== | + | ====1.8 - The cd Command=== |
This command' | This command' | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
/tmp | /tmp | ||
- | [trainee@centos7 | + | [trainee@centos8 |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **help** command with **cd** option to view the command line switches. | **To do** : Use the **help** command with **cd** option to view the command line switches. | ||
</ | </ | ||
- | ====The ls Command=== | + | ====1.9 - The ls Command=== |
This commands output lists information about the files in directory specified as an argument. If no argument is specified, the output lists the files in the current working directory: | This commands output lists information about the files in directory specified as an argument. If no argument is specified, the output lists the files in the current working directory: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | hsperfdata_root | + | systemd-private-d9ff2376a8a44f0392f860d80c839be4-chronyd.service-6im4Ii |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **ls** command to view the command line switches. | **To do** : Use the **--help** option of the **ls** command to view the command line switches. | ||
</ | </ | ||
- | ====The lsof Command==== | + | ====1.10 - The lsof Command==== |
This command' | This command' | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
Password: fenestros | Password: fenestros | ||
- | Last login: Thu Sep 29 06:24:28 CEST 2016 on pts/0 | + | [root@centos8 |
- | [root@centos7 | + | COMMAND |
- | COMMAND | + | SIZE/ |
- | systemd | + | systemd |
- | systemd | + | 224 128 / |
- | systemd | + | systemd |
- | systemd | + | 224 128 / |
- | systemd | + | systemd |
- | systemd | + | |
- | systemd | + | systemd |
- | systemd | + | |
- | systemd | + | systemd |
- | systemd | + | 628744 |
- | systemd | + | systemd |
- | systemd | + | 969832 |
- | systemd | + | systemd |
- | systemd | + | |
- | systemd | + | systemd |
- | systemd | + | |
- | systemd | + | systemd |
- | systemd | + | |
- | systemd | + | systemd |
- | systemd | + | |
- | systemd | + | systemd |
- | systemd | + | |
--More-- | --More-- | ||
</ | </ | ||
Ligne 264: | Ligne 351: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **lsof** command to view the command line switches. | **To do** : Use the **--help** option of the **lsof** command to view the command line switches. | ||
</ | </ | ||
- | ==== The touch Command==== | + | ====1.11 - The touch Command==== |
This command updates the access and modification times of one or several file(s) to the current time. If the file does not exist, the system creates an empty file: | This command updates the access and modification times of one or several file(s) to the current time. If the file does not exist, the system creates an empty file: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
logout | logout | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | hsperfdata_root | + | systemd-private-d9ff2376a8a44f0392f860d80c839be4-chronyd.service-6im4Ii |
- | inode | + | |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **touch** command to view the command line switches. | **To do** : Use the **--help** option of the **touch** command to view the command line switches. | ||
</ | </ | ||
- | ====The echo Command ==== | + | ====1.12 - The echo Command ==== |
This command writes the arguments to the standard output (i.e. the screen): | This command writes the arguments to the standard output (i.e. the screen): | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
fenestros | fenestros | ||
</ | </ | ||
Ligne 298: | Ligne 384: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **help** command with **echo** option to view the command line switches. | **To do** : Use the **help** command with **echo** option to view the command line switches. | ||
</ | </ | ||
- | ====The cp Command=== | + | ====1.13 - The cp Command=== |
This command is used to copy a source to a destination or multiple sources to a directory: | This command is used to copy a source to a destination or multiple sources to a directory: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | total 4 | + | total 0 |
- | drwxr-xr-x. 2 trainee trainee | + | -rw-rw-r--. 1 trainee trainee 0 Apr 20 03:36 test |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | -rw-rw-r--. 1 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | -rw-rw-r--. 1 trainee trainee 442 Sep 29 00:53 vitext | + | |
</ | </ | ||
Ligne 328: | Ligne 405: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **cp** command to view the command line switches. | **To do** : Use the **--help** option of the **cp** command to view the command line switches. | ||
</ | </ | ||
- | ==== The file Command==== | + | ====1.14 - The file Command==== |
This command determines a file type: | This command determines a file type: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
/ | / | ||
</ | </ | ||
Ligne 348: | Ligne 425: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
</ | </ | ||
Ligne 354: | Ligne 431: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
/ | / | ||
</ | </ | ||
Ligne 360: | Ligne 437: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **file** command to view the command line switches. | **To do** : Use the **--help** option of the **file** command to view the command line switches. | ||
</ | </ | ||
- | ====The cat Command==== | + | ====1.15 - The cat Command==== |
This commands concatenate files, or standard input, to standard output. In the case of only one file as an argument, the effective result is to print the file contents to the screen: | This commands concatenate files, or standard input, to standard output. In the case of only one file as an argument, the effective result is to print the file contents to the screen: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
fenestros | fenestros | ||
</ | </ | ||
Ligne 375: | Ligne 452: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **cat** command to view the command line switches. | **To do** : Use the **--help** option of the **cat** command to view the command line switches. | ||
</ | </ | ||
- | ==== The mv Command==== | + | ====1.16 - The mv Command==== |
This command renames a source to a destination or moves sources to a directory: | This command renames a source to a destination or moves sources to a directory: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
+ | total 0 | ||
+ | [trainee@centos8 tmp]$ mv test TeSt | ||
+ | [trainee@centos8 tmp]$ ls -l | ||
total 4 | total 4 | ||
- | drwxr-xr-x. 2 trainee trainee | + | drwx------. |
- | drwxr-xr-x. 2 trainee trainee | + | -rw-rw-r--. 1 trainee trainee 10 Apr 20 03:38 TeSt |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | -rw-rw-r--. 1 trainee trainee 442 Sep 29 00:53 vitext | + | |
- | [trainee@centos7 tmp]$ mv test TeSt | + | |
- | [trainee@centos7 tmp]$ ls -l | + | |
- | total 4 | + | |
- | drwxr-xr-x. 2 root | + | |
- | drwxr-xr-x. 2 root | + | |
- | drwx------. 3 root root 60 Sep 28 10:49 systemd-private-45071248a58f4fd2a4de940a5734c8ec-cups.service-ODc5L6 | + | |
- | -rw-rw-r--. 1 trainee trainee | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | Note the use of the shortcut **.** which indicates the current working directory. | + | **Important** - Note the use of the shortcut **.** which indicates the current working directory. |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **mv** command to view the command line switches. | **To do** : Use the **--help** option of the **mv** command to view the command line switches. | ||
</ | </ | ||
- | ====The mkdir Command==== | + | ====1.17 - The mkdir Command==== |
This command creates the directory(ies) if it (they) does (do) not exist: | This command creates the directory(ies) if it (they) does (do) not exist: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | Desktop | + | testdir |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **mkdir** command to view the command line switches. | **To do** : Use the **--help** option of the **mkdir** command to view the command line switches. | ||
</ | </ | ||
- | ====The rmdir Command==== | + | ====1.18 - The rmdir Command==== |
This command removes the directory(ies) if it (they) is (are) **empty**: | This command removes the directory(ies) if it (they) is (are) **empty**: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | Desktop | + | [trainee@centos8 ~]$ |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **rmdir** command to view the command line switches. | **To do** : Use the **--help** option of the **rmdir** command to view the command line switches. | ||
</ | </ | ||
- | ==== The rm Command==== | + | ====1.19 - The rm Command==== |
This command removes a directory, empty of not, as well as files: | This command removes a directory, empty of not, as well as files: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
testdir1/: | testdir1/: | ||
total 4 | total 4 | ||
- | -rw-rw-r--. 1 trainee trainee 10 Sep 29 18:13 TeSt | + | -rw-rw-r--. 1 trainee trainee 10 Apr 20 03:44 TeSt |
- | [trainee@centos7 | + | [trainee@centos8 |
- | rmdir: failed to remove | + | rmdir: failed to remove |
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | Desktop | + | [trainee@centos8 ~]$ |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **rm** command to view the command line switches. | **To do** : Use the **--help** option of the **rm** command to view the command line switches. | ||
</ | </ | ||
- | ==== The sort Command ==== | + | ====1.20 - The sort Command ==== |
This command writes a sorted concatenation of all files to standard output: | This command writes a sorted concatenation of all files to standard output: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
- | [trainee@centos7 | + | [trainee@centos8 |
- | aac bca | + | aac |
- | abc Desktop | + | [trainee@centos8 |
- | [trainee@centos7 | + | |
aac | aac | ||
abc | abc | ||
bca | bca | ||
- | Desktop | ||
- | Documents | ||
- | Downloads | ||
- | Music | ||
- | Pictures | ||
- | Public | ||
- | Templates | ||
- | Videos | ||
- | vitext | ||
xyz | xyz | ||
- | [trainee@centos7 | + | [trainee@centos8 |
xyz | xyz | ||
- | vitext | ||
- | Videos | ||
- | Templates | ||
- | Public | ||
- | Pictures | ||
- | Music | ||
- | Downloads | ||
- | Documents | ||
- | Desktop | ||
bca | bca | ||
abc | abc | ||
Ligne 520: | Ligne 567: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **sort** command to view the command line switches. | **To do** : Use the **--help** option of the **sort** command to view the command line switches. | ||
</ | </ | ||
- | ==== The more Command ==== | + | ====1.21 - The more Command ==== |
This command is used to display a long file page by page: | This command is used to display a long file page by page: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
# / | # / | ||
- | # $Id: services,v 1.55 2013/04/14 ovasik Exp $ | + | # $Id: services,v 1.49 2017/08/18 12: |
# | # | ||
# Network services, Internet style | # Network services, Internet style | ||
- | # IANA services version: last updated | + | # IANA services version: last updated |
# | # | ||
# Note that it is presently the policy of IANA to assign a single well-known | # Note that it is presently the policy of IANA to assign a single well-known | ||
Ligne 562: | Ligne 609: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **more** command to view the command line switches. | **To do** : Use the **--help** option of the **more** command to view the command line switches. | ||
</ | </ | ||
- | ====The less Command==== | + | ====1.22 - The less Command==== |
The **less** command produces a similar result to that of the **more** command. Practice using the less command and refer to the help using **less --help**. Which command seems the most powerful and versatile ? | The **less** command produces a similar result to that of the **more** command. Practice using the less command and refer to the help using **less --help**. Which command seems the most powerful and versatile ? | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
# / | # / | ||
- | # $Id: services,v 1.55 2013/04/14 ovasik Exp $ | + | # $Id: services,v 1.49 2017/08/18 12: |
# | # | ||
# Network services, Internet style | # Network services, Internet style | ||
- | # IANA services version: last updated | + | # IANA services version: last updated |
# | # | ||
# Note that it is presently the policy of IANA to assign a single well-known | # Note that it is presently the policy of IANA to assign a single well-known | ||
Ligne 600: | Ligne 647: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **less** command to view the command line switches. | **To do** : Use the **--help** option of the **less** command to view the command line switches. | ||
</ | </ | ||
- | ====The find Command=== | + | ====1.23 - The find Command=== |
This command is used to search for a specific file or directory. The default path is the **current directory** and default expression is **-print**: | This command is used to search for a specific file or directory. The default path is the **current directory** and default expression is **-print**: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
find: ‘acc’: No such file or directory | find: ‘acc’: No such file or directory | ||
- | [trainee@centos7 | + | [trainee@centos8 |
aac | aac | ||
</ | </ | ||
Ligne 621: | Ligne 668: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **find** command to view the command line switches. | **To do** : Use the **--help** option of the **find** command to view the command line switches. | ||
</ | </ | ||
- | ====The su Command=== | + | ====1.24 - The su Command=== |
This command is used to change the effective user id and group id to that of the user passed as an argument. When executed with no argument, the system assumes the destination user is **root**: | This command is used to change the effective user id and group id to that of the user passed as an argument. When executed with no argument, the system assumes the destination user is **root**: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
Password: fenestros | Password: fenestros | ||
- | Last login: Thu Sep 29 17:08:56 CEST 2016 on pts/0 | + | [root@centos8 ~]# |
</ | </ | ||
Ligne 641: | Ligne 688: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **su** command to view the command line switches. | **To do** : Use the **--help** option of the **su** command to view the command line switches. | ||
</ | </ | ||
- | ====The updatedb and locate Commands==== | + | ====1.25 - The updatedb and locate Commands==== |
The **locate** command is used to list files in databases that match a pattern supplied as an argument to the command. The **locate** command uses a database. This database needs to be created using the **updatedb** command before using the **locate** command. | The **locate** command is used to list files in databases that match a pattern supplied as an argument to the command. The **locate** command uses a database. This database needs to be created using the **updatedb** command before using the **locate** command. | ||
Ligne 652: | Ligne 699: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | -rw-r-----. 1 root slocate | + | -rw-r-----. 1 root slocate |
</ | </ | ||
Ligne 663: | Ligne 710: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
PRUNE_BIND_MOUNTS = " | PRUNE_BIND_MOUNTS = " | ||
- | PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset debugfs devpts ecryptfs exofs fuse fuse.sshfs fusectl gfs gfs2 hugetlbfs inotifyfs iso9660 jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs sfs sockfs sysfs tmpfs ubifs udf usbfs" | + | PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset debugfs devpts ecryptfs exofs fuse fuse.sshfs fusectl gfs gfs2 gpfs hugetlbfs inotifyfs iso9660 jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs sfs sockfs sysfs tmpfs ubifs udf usbfs ceph fuse.ceph" |
- | PRUNENAMES = ".git .hg .svn" | + | PRUNENAMES = ".git .hg .svn .bzr .arch-ids {arch} CVS" |
- | PRUNEPATHS = "/afs /media /mnt /net /sfs /tmp /udev / | + | PRUNEPATHS = "/afs /media /mnt /net /sfs /tmp /udev / |
</ | </ | ||
Ligne 673: | Ligne 720: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 | + | [root@centos8 |
/ | / | ||
- | /usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/scsi/aacraid | + | /usr/lib/.build-id/10/ |
- | /usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/scsi/aacraid/aacraid.ko | + | /usr/lib/.build-id/22/e20bcaaca5ed745d4f5f319ce3cc15e0db8d56 |
- | /usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/scsi/aacraid | + | /usr/lib/ |
- | /usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/scsi/aacraid/aacraid.ko | + | /usr/lib/.build-id/45/bdf33b3fef84664d179d00e997daac1648973b |
- | /usr/lib/python2.7/site-packages/ipalib/plugins/caacl.py | + | /usr/lib/.build-id/ |
- | /usr/lib/python2.7/site-packages/ipalib/plugins/caacl.pyc | + | /usr/lib/.build-id/55/2e764cb2c3aaacaeec1027b10ce22fb78a5896 |
- | /usr/lib/python2.7/site-packages/ipalib/plugins/caacl.pyo | + | /usr/lib/ |
- | /usr/share/gtk-doc/html/gst-plugins-good-plugins-1.0/gst-plugins-good-plugins-aacparse.html | + | /usr/lib/.build-id/ |
- | /usr/share/gupnp-dlna-2.0/dlna-profiles/aac.xml | + | /usr/lib/.build-id/ |
+ | /usr/lib/.build-id/79/dc2cf8dc9bd9617d5e897faac79f7458856f19 | ||
+ | /usr/lib/.build-id/ | ||
+ | /usr/lib/.build-id/8a/ | ||
+ | / | ||
+ | /usr/lib/.build-id/ | ||
+ | /usr/lib/.build-id/9a/ | ||
+ | / | ||
+ | /usr/lib/.build-id/ | ||
+ | /usr/lib/.build-id/b2/cee7e58576f3167aacb613906c9790c5bcd266 | ||
+ | /usr/lib/.build-id/ | ||
+ | /usr/lib/.build-id/f1/b2efd3d36aecaac279b4a77d00657356b2585f | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | /usr/lib/modules/ | ||
+ | / | ||
/ | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **updatedb** and **locate** commands to view their command line switches. | **To do** : Use the **--help** option of the **updatedb** and **locate** commands to view their command line switches. | ||
</ | </ | ||
- | ==== The whereis Command=== | + | ==== 1.26 - The whereis Command=== |
This command is used to show the full paths of the executable, the configuration files and the manuals associated with the argument: | This command is used to show the full paths of the executable, the configuration files and the manuals associated with the argument: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
passwd: / | passwd: / | ||
</ | </ | ||
Ligne 711: | Ligne 768: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **whereis** command to view the command line switches. | **To do** : Use the **--help** option of the **whereis** command to view the command line switches. | ||
</ | </ | ||
- | ==== The which Command==== | + | ==== 1.27 - The which Command==== |
This command searches the PATH variable and returns to standard output the first full path associated with the argument: | This command searches the PATH variable and returns to standard output the first full path associated with the argument: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | /bin/passwd | + | /usr/bin/passwd |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **which** command to view the command line switches. | **To do** : Use the **--help** option of the **which** command to view the command line switches. | ||
</ | </ | ||
- | ====The uptime Command==== | + | ====1.28 - The uptime Command==== |
This command prints to standard output the current time, the length of time the system has been up, the number of users on the system and the average number of jobs in the run queue over the last 1, 5 and 15 minutes: | This command prints to standard output the current time, the length of time the system has been up, the number of users on the system and the average number of jobs in the run queue over the last 1, 5 and 15 minutes: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 19:18:57 up 1 day, 8:30, 1 user, load average: 0.10, 0.09, 0.07 | + | 03:55:13 up 15:50, 1 user, load average: 0.01, 0.00, 0.00 |
</ | </ | ||
Ligne 743: | Ligne 800: | ||
The switches associated with this command are: | The switches associated with this command are: | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **uptime** command to view the command line switches. | **To do** : Use the **--help** option of the **uptime** command to view the command line switches. | ||
</ | </ | ||
- | ====The w Command==== | + | ====1.29 - The w Command==== |
This command outputs the same data as the **uptime** command on the first line and then complements this information with the details of each user connected to the system, including what each user is currently doing. This is the replacement under Linux for the Unix command **whodo**: | This command outputs the same data as the **uptime** command on the first line and then complements this information with the details of each user connected to the system, including what each user is currently doing. This is the replacement under Linux for the Unix command **whodo**: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 19:28:55 up 1 day, 8:40, 1 user, load average: 0.00, 0.01, 0.05 | + | 03:55:16 up 15:50, 1 user, load average: 0.01, 0.00, 0.00 |
USER | USER | ||
- | trainee | + | trainee |
</ | </ | ||
Ligne 764: | Ligne 821: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **w** command to view the command line switches. | **To do** : Use the **--help** option of the **w** command to view the command line switches. | ||
</ | </ | ||
- | ====The uname Command==== | + | ====1.30 - The uname Command==== |
This command prints system information to the standard output: | This command prints system information to the standard output: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux centos7.fenestros.loc 3.10.0-327.13.1.el7.x86_64 #1 SMP Thu Mar 31 16:04:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux | + | Linux centos8.ittraining.loc 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Apr 8 19:01:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
- | [root@centos7 | + | [root@centos8 |
Linux | Linux | ||
- | [root@centos7 | + | [root@centos8 |
- | centos7.fenestros.loc | + | centos8.ittraining.loc |
- | [root@centos7 | + | [root@centos8 |
- | 3.10.0-327.13.1.el7.x86_64 | + | 4.18.0-240.22.1.el8_3.x86_64 |
- | [root@centos7 | + | [root@centos8 |
- | #1 SMP Thu Mar 31 16:04:38 UTC 2016 | + | #1 SMP Thu Apr 8 19:01:30 UTC 2021 |
- | [root@centos7 | + | [root@centos8 |
x86_64 | x86_64 | ||
- | [root@centos7 | + | [root@centos8 |
x86_64 | x86_64 | ||
- | [root@centos7 | + | [root@centos8 |
x86_64 | x86_64 | ||
- | [root@centos7 | + | [root@centos8 |
GNU/Linux | GNU/Linux | ||
</ | </ | ||
Ligne 795: | Ligne 852: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **uname** command to view the command line switches. | **To do** : Use the **--help** option of the **uname** command to view the command line switches. | ||
</ | </ | ||
- | ====The du Command==== | + | ====1.31 - The du Command==== |
This command summarizes disk usage of each file, recursively for directories: | This command summarizes disk usage of each file, recursively for directories: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
0 /bin | 0 /bin | ||
- | 187M /boot | + | 192M /boot |
0 /dev | 0 /dev | ||
- | 33M /etc | + | 23M /etc |
- | 20M /home | + | 16K /home |
0 /lib | 0 /lib | ||
0 /lib64 | 0 /lib64 | ||
- | 0 / | ||
0 /media | 0 /media | ||
0 /mnt | 0 /mnt | ||
- | 173M /opt | + | 0 /opt |
0 /proc | 0 /proc | ||
- | 43M /root | + | 32K /root |
- | 8.7M /run | + | 8.6M /run |
0 /sbin | 0 /sbin | ||
0 /srv | 0 /srv | ||
0 /sys | 0 /sys | ||
- | 64K /tmp | + | 0 /tmp |
- | 3.6G /usr | + | 1.9G /usr |
- | 228M /var | + | 211M /var |
</ | </ | ||
Ligne 833: | Ligne 889: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **du** command to view the command line switches. | **To do** : Use the **--help** option of the **du** command to view the command line switches. | ||
</ | </ | ||
- | ==== The clear Command ==== | + | ==== 1.32 - The clear Command ==== |
This command is used to clear the current screen of the terminal: | This command is used to clear the current screen of the terminal: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
- | ==== The exit Command ==== | + | ==== 1.33 - The exit Command ==== |
This command exits the current shell: | This command exits the current shell: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | logou | + | logout |
- | [trainee@centos7 | + | [trainee@centos8 |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **help** command with **exit** option to view the command line switches. | **To do** : Use the **help** command with **exit** option to view the command line switches. | ||
</ | </ | ||
- | ====The logout Command==== | + | ====1.34 - The logout Command==== |
This command logs out a user from a login shell writing the utmp and wtmp entries in the log files. | This command logs out a user from a login shell writing the utmp and wtmp entries in the log files. | ||
Ligne 869: | Ligne 925: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **help** command with **logout** option to view the command line switches. | **To do** : Use the **help** command with **logout** option to view the command line switches. | ||
</ | </ | ||
- | ====The sleep Command ==== | + | ====1.35 - The sleep Command ==== |
This command pauses for a number seconds. The number is specified as the first argument. | This command pauses for a number seconds. The number is specified as the first argument. | ||
+ | |||
+ | < | ||
+ | [trainee@centos8 ~]$ sleep 10 | ||
+ | |||
+ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **sleep** command to view the command line switches. | **To do** : Use the **--help** option of the **sleep** command to view the command line switches. | ||
</ | </ | ||
- | ====The wall Command==== | + | ====1.36 - The wall Command==== |
Wall sends a message to everybody logged in with their mesg(1) permission set to yes. The message can be given as an argument to wall, or it can be sent to wall's standard input. | Wall sends a message to everybody logged in with their mesg(1) permission set to yes. The message can be given as an argument to wall, or it can be sent to wall's standard input. | ||
Ligne 890: | Ligne 951: | ||
< | < | ||
- | [root@centos7 | + | [trainee@centos8 ~]$ su - |
- | [root@centos7 ~]# | + | Password: |
- | Broadcast message from root@centos7.fenestros.loc (pts/0) (Fri Sep 30 05:35:26 2016): | + | [root@centos8 |
+ | | ||
+ | Broadcast message from trainee@centos8.ittraining.loc (pts/0) (Tue Apr 20 04:11 | ||
+ | | ||
this is a message from root | this is a message from root | ||
- | [Enter] | + | |
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
Ligne 902: | Ligne 965: | ||
< | < | ||
- | [trainee@centos7 ~]$ | + | Activate the web console with: systemctl enable --now cockpit.socket |
- | Broadcast message from root@centos7.fenestros.loc (pts/0) (Fri Sep 30 05:35:26 2016): | + | |
- | this is a message from root | + | Last login: Tue Apr 20 02:21:15 2021 from 10.0.2.2 |
+ | |||
+ | Broadcast message from trainee@centos8.ittraining.loc (pts/0) (Tue Apr 20 04:11 | ||
+ | |||
+ | this is a message from root | ||
+ | [Enter] | ||
+ | [trainee@centos8 ~]$ | ||
+ | |||
</ | </ | ||
- | Now look at the end of the**/ | + | La commande wall ignore la variable d’environnement TZ. L’heure affichée dans la première page est basée sur les paramètres de régionalisation du système |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Sep 30 05:31:08 centos7 sh: Sleeping '' | + | Tue Apr 20 04:23:19 EDT 2021 |
- | Sep 30 05:34:16 centos7 sh: Sleeping '' | + | |
- | Sep 30 05:35:13 centos7 systemd: Started Session 311 of user trainee. | + | |
- | Sep 30 05:35:13 centos7 systemd-logind: | + | |
- | Sep 30 05:35:13 centos7 systemd: Starting Session 311 of user trainee. | + | |
- | Sep 30 05:35:13 centos7 dbus[515]: [system] Activating service name=' | + | |
- | Sep 30 05:35:13 centos7 dbus-daemon: | + | |
- | Sep 30 05:35:13 centos7 dbus[515]: [system] Successfully activated service ' | + | |
- | Sep 30 05:35:13 centos7 dbus-daemon: | + | |
- | Sep 30 05:35:26 centos7 wall[27550]: | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | ====1.37 - The seq Command==== |
- | **Important** : La commande wall ignore la variable d’environnement TZ. L’heure affichée dans la première page est basée sur les paramètres de régionalisation du système. | + | |
- | </ | + | |
- | + | ||
- | ====The seq Command==== | + | |
The **seq** command prints numbers from FIRST to LAST, in steps of INCREMENT: | The **seq** command prints numbers from FIRST to LAST, in steps of INCREMENT: | ||
Ligne 939: | Ligne 995: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
1 | 1 | ||
2 | 2 | ||
Ligne 950: | Ligne 1006: | ||
9 | 9 | ||
10 | 10 | ||
- | [root@centos7 | + | [root@centos8 |
20 | 20 | ||
21 | 21 | ||
Ligne 962: | Ligne 1018: | ||
29 | 29 | ||
30 | 30 | ||
- | [root@centos7 | + | [root@centos8 |
20 | 20 | ||
30 | 30 | ||
Ligne 971: | Ligne 1027: | ||
80 | 80 | ||
90 | 90 | ||
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **seq** command to view the command line switches. | **To do** : Use the **--help** option of the **seq** command to view the command line switches. | ||
</ | </ | ||
- | ====The screen Command==== | + | ====1.38 - The screen Command==== |
Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive | Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive | ||
Ligne 987: | Ligne 1043: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
/ | / | ||
- | [root@centos7 ~]# yum install screen | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: ftp.rezopole.net | ||
- | * extras: centos.mirror.ate.info | ||
- | * updates: centos.mirror.fr.planethoster.net | ||
- | Resolving Dependencies | ||
- | --> Running transaction check | ||
- | ---> Package screen.x86_64 0: | ||
- | --> Finished Dependency Resolution | ||
- | Dependencies Resolved | + | [root@centos8 ~]# dnf makecache |
+ | CentOS Linux 8 - AppStream | ||
+ | CentOS Linux 8 - BaseOS | ||
+ | CentOS Linux 8 - Extras | ||
+ | Metadata cache created. | ||
- | ================================================================================= | + | [root@centos8 ~]# dnf install screen -y |
- | | + | Last metadata expiration check: 0:00:04 ago on Tue 20 Apr 2021 04:33:50 AM EDT. |
- | ================================================================================= | + | No match for argument: screen |
+ | Error: Unable to find a match: screen | ||
+ | |||
+ | [root@centos8 ~]# dnf install epel-release -y | ||
+ | ... 1/1 | ||
+ | Installed: | ||
+ | epel-release-8-8.el8.noarch | ||
+ | |||
+ | Complete! | ||
+ | |||
+ | [root@centos8 ~]# dnf install screen -y | ||
+ | Extra Packages for Enterprise Linux Modular 8 - x86_64 | ||
+ | Extra Packages for Enterprise Linux 8 - x86_64 | ||
+ | Last metadata expiration check: 0:00:01 ago on Tue 20 Apr 2021 04:36:11 AM EDT. | ||
+ | Dependencies resolved. | ||
+ | ============================================================================================================================================================================================================================================== | ||
+ | | ||
+ | ============================================================================================================================================================================================================================================== | ||
Installing: | Installing: | ||
- | | + | |
Transaction Summary | Transaction Summary | ||
- | ================================================================================= | + | ============================================================================================================================================================================================================================================== |
Install | Install | ||
- | Total download size: 552 k | + | Total download size: 582 k |
- | Installed size: 914 k | + | Installed size: 971 k |
- | Is this ok [y/d/N]: y | + | Downloading |
- | Downloading | + | screen-4.6.2-10.el8.x86_64.rpm 283 kB/s | 582 kB |
- | screen-4.1.0-0.23.20120314git3c2946.el7_2.x86_64.rpm | + | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+ | Total 229 kB/s | 582 kB | ||
+ | warning: / | ||
+ | Extra Packages for Enterprise Linux 8 - x86_64 | ||
+ | Importing GPG key 0x2F86D6A1: | ||
+ | | ||
+ | | ||
+ | | ||
+ | Key imported successfully | ||
Running transaction check | Running transaction check | ||
+ | Transaction check succeeded. | ||
Running transaction test | Running transaction test | ||
- | Transaction test succeeded | + | Transaction test succeeded. |
Running transaction | Running transaction | ||
- | | + | |
- | | + | Running scriptlet: screen-4.6.2-10.el8.x86_64 |
+ | Installing | ||
+ | | ||
+ | Verifying | ||
Installed: | Installed: | ||
- | screen.x86_64 0:4.1.0-0.23.20120314git3c2946.el7_2 | + | screen-4.6.2-10.el8.x86_64 |
Complete! | Complete! | ||
- | [root@centos7 | + | |
- | /bin/screen | + | [root@centos8 |
+ | /usr/bin/screen | ||
</ | </ | ||
Ligne 1035: | Ligne 1115: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** - When using RHEL/ | + | **Important** - When using RHEL/ |
</ | </ | ||
Ligne 1045: | Ligne 1125: | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** - When using RHEL/ | + | **Important** - When using RHEL/ |
</ | </ | ||
Ligne 1053: | Ligne 1133: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
There is a screen on: | There is a screen on: | ||
- | | + | |
- | 1 Socket in /var/ | + | 1 Socket in / |
</ | </ | ||
Ligne 1062: | Ligne 1142: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [1] 2272 | + | [1] 12187 |
- | [root@centos7 | + | [root@centos8 |
- | [1]+ Running | + | [1]+ 12187 Running |
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
Ligne 1072: | Ligne 1152: | ||
< | < | ||
- | [root@centos7 | + | < |
- | [detached from 25812.mysession] | + | [root@centos8 |
- | [root@centos7 | + | [detached from 12149.mysession] |
+ | [root@centos8 | ||
</ | </ | ||
Ligne 1080: | Ligne 1161: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
Ligne 1086: | Ligne 1167: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [1]+ Running | + | [1]+ 12187 Running |
</ | </ | ||
Ligne 1095: | Ligne 1176: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [detached from 25812.mysession] | + | [detached from 12149.mysession] |
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
Ligne 1103: | Ligne 1184: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
Ligne 1109: | Ligne 1190: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
There are screens on: | There are screens on: | ||
- | | + | |
- | | + | |
- | 2 Sockets in /var/ | + | 2 Sockets in / |
</ | </ | ||
Ligne 1119: | Ligne 1200: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
+ | |||
+ | [root@centos8 ~]# screen -ls | ||
+ | There is a screen on: | ||
+ | 12149.mysession (Attached) | ||
+ | 1 Socket in / | ||
+ | [root@centos8 ~]# sleep 9999 & | ||
+ | [1] 12187 | ||
+ | [root@centos8 ~]# jobs -l | ||
+ | [1]+ 12187 Running | ||
+ | [root@centos8 ~]# jobs -l | ||
+ | [1]+ 12187 Running | ||
+ | [root@centos8 ~]# | ||
+ | [root@centos8 ~]# screen -ls | ||
+ | There are screens on: | ||
+ | 12191.mysession1 | ||
+ | 12149.mysession (Attached) | ||
+ | 2 Sockets in / | ||
</ | </ | ||
- | Finally, check out what has happened: | + | Once again detach the current screen by pressing the < |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [1] 2272 | + | / |
- | [root@centos7 | + | [root@centos8 |
- | [1]+ Running | + | [detached from 12149.mysession] |
- | [root@centos7 | + | [root@centos8 |
- | [1]+ Running | + | [detached from 12149.mysession] |
- | [root@centos7 | + | [root@centos8 |
- | There is a screen on: | + | [detached from 12191.mysession1] |
- | 25812.mysession (Attached) | + | [root@centos8 ~]# |
- | 1 Socket in / | + | </ |
- | [root@centos7 | + | Now check which screen you are connected to: |
+ | |||
+ | < | ||
+ | [root@centos8 | ||
There are screens on: | There are screens on: | ||
- | 14942.mysession1 | + | 12191.mysession1 (Detached) |
- | 25812.mysession (Attached) | + | 12149.mysession (Attached) |
- | 2 Sockets in /var/ | + | 2 Sockets in /run/ |
+ | </ | ||
+ | |||
+ | Finally, kill the two sessions: | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# screen -XS 12191 quit | ||
+ | [root@centos8 ~]# screen -XS 12149 quit | ||
+ | [root@centos8 ~]# screen -ls | ||
+ | No Sockets found in / | ||
</ | </ | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **screen** command to view the command line switches. | **To do** : Use the **--help** option of the **screen** command to view the command line switches. | ||
</ | </ | ||
- | =====Switches and Arguments===== | + | =====LAB #2 - Switches and Arguments===== |
Switches under Linux can either be short or long. Several differences are important to note. | Switches under Linux can either be short or long. Several differences are important to note. | ||
Ligne 1163: | Ligne 1273: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | total 244 | + | total 0 |
- | | + | 16800396 |
- | 128 dr-xr-xr-x. | + | |
- | | + | 25447488 |
- | 24858 drwxr-xr-x. | + | 8388741 |
- | 13597 drwxrwxrwt. | + | 143 drwx------. |
- | 287056 drwxr-xr-x. | + | |
- | 24861 srw-------. | + | |
- | 25344 srw-------. | + | 17319048 |
- | 16615 drwx------. | + | [root@centos8 |
- | | + | total 0 |
- | | + | 16800396 |
- | | + | |
- | 8098838 -rw-------. | + | 25447488 |
- | [root@centos7 | + | 8388741 drwxrwxrwt. |
- | total 244 | + | 143 drwx------. |
- | | + | |
- | 128 dr-xr-xr-x. | + | |
- | | + | 17319048 drwxrwxrwt. |
- | | + | [root@centos8 ~]# ls -ial /tmp |
- | | + | total 0 |
- | 287056 drwxr-xr-x. 2 root root 100 Sep 28 12:30 inode | + | 16800396 drwxrwxrwt. |
- | | + | 128 dr-xr-xr-x. 17 root root 224 Apr 19 11:50 .. |
- | | + | 25447488 drwxrwxrwt. |
- | | + | |
- | | + | 143 drwx------. |
- | | + | |
- | | + | |
- | 8098838 -rw-------. | + | 17319048 |
</ | </ | ||
Ligne 1198: | Ligne 1308: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | total 244 | + | total 0 |
- | | + | 16800396 |
- | 128 dr-xr-xr-x. | + | |
- | | + | 25447488 |
- | 24858 drwxr-xr-x. | + | 8388741 |
- | 13597 drwxrwxrwt. | + | 143 drwx------. |
- | 287056 drwxr-xr-x. | + | |
- | 24861 srw-------. | + | |
- | 25344 srw-------. | + | 17319048 |
- | 16615 drwx------. | + | [root@centos8 |
- | | + | |
- | | + | |
- | | + | |
- | 8098838 -rw-------. | + | |
- | + | ||
- | [root@centos7 | + | |
ls: unrecognized option ' | ls: unrecognized option ' | ||
- | Try 'ls --help' | + | Try 'ls --help' |
</ | </ | ||
Ligne 1223: | Ligne 1327: | ||
</ | </ | ||
- | =====Manipulating Text Files===== | + | =====LAB #3 - Regular Expressions===== |
Text files play a very important role under Linux. For example, almost all configuration files are simple text files and being able to manipulate them is of great importance. Manipulating text files is essentially achieved by using **Regular Expressions**. There are two types of Regular Expressions: | Text files play a very important role under Linux. For example, almost all configuration files are simple text files and being able to manipulate them is of great importance. Manipulating text files is essentially achieved by using **Regular Expressions**. There are two types of Regular Expressions: | ||
Ligne 1229: | Ligne 1333: | ||
* The IEEE POSIX Basic Regular Expressions (**BRE**) understood by the commands **vi**, **grep**, **expr** and **sed**, | * The IEEE POSIX Basic Regular Expressions (**BRE**) understood by the commands **vi**, **grep**, **expr** and **sed**, | ||
* The IEEE POSIX Extended Regular Expressions (**ERE**) understood by the commands **egrep** ( grep -E ) and **awk**. | * The IEEE POSIX Extended Regular Expressions (**ERE**) understood by the commands **egrep** ( grep -E ) and **awk**. | ||
- | |||
- | ====Regular Expressions==== | ||
Regular Expressions use **Metacharacters**. Certain are common to both BREs and EREs: | Regular Expressions use **Metacharacters**. Certain are common to both BREs and EREs: | ||
Ligne 1269: | Ligne 1371: | ||
| %%|%% | Matches either the expression before or the expression after the operator | | | %%|%% | Matches either the expression before or the expression after the operator | | ||
| () | Combines the Reguler Expressions between the parentheses | | | () | Combines the Reguler Expressions between the parentheses | | ||
+ | |||
+ | =====Manipulating Text Files===== | ||
====Text-search Utilities==== | ====Text-search Utilities==== | ||
Ligne 1282: | Ligne 1386: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **grep** command to view the command line switches. | **To do** : Use the **--help** option of the **grep** command to view the command line switches. | ||
</ | </ | ||
Ligne 1292: | Ligne 1396: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **egrep** command to view the command line switches. | **To do** : Use the **--help** option of the **egrep** command to view the command line switches. | ||
</ | </ | ||
Ligne 1300: | Ligne 1404: | ||
The **fgrep** command is identical to the **grep** command when used with the **-F** switch. Both have no knowledge of Regular Expressions. | The **fgrep** command is identical to the **grep** command when used with the **-F** switch. Both have no knowledge of Regular Expressions. | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **fgrep** command to view the command line switches. | **To do** : Use the **--help** option of the **fgrep** command to view the command line switches. | ||
</ | </ | ||
- | ===LAB #1 - Using grep, egrep and fgrep=== | + | ===LAB #4 - Using grep, egrep and fgrep=== |
- | Download | + | Create |
- | <file - greptest> | + | <code> |
+ | [root@centos8 ~]# cd /tmp | ||
+ | [root@centos8 tmp]# vi greptest | ||
+ | [root@centos8 tmp]# cat greptest | ||
fenestrOS | fenestrOS | ||
fenestros | fenestros | ||
Ligne 1316: | Ligne 1423: | ||
.fe | .fe | ||
£ | £ | ||
- | </ | ||
- | |||
- | Move the file to the **/tmp** directory: | ||
- | |||
- | < | ||
- | [root@centos7 ~]# mv / | ||
</ | </ | ||
Ligne 1327: | Ligne 1428: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
fenestrOS | fenestrOS | ||
fenestros | fenestros | ||
Ligne 1338: | Ligne 1439: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
fenestrOS | fenestrOS | ||
fenestros | fenestros | ||
Ligne 1350: | Ligne 1451: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
555-5555 | 555-5555 | ||
</ | </ | ||
Ligne 1357: | Ligne 1458: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
f | f | ||
£ | £ | ||
Ligne 1365: | Ligne 1466: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | .fenestros | + | f |
- | .fe | + | £ |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | The grep command can also be used to search for a string in all the files within a specific directory as follows **grep -rnw ' | + | **Important** - The grep command can also be used to search for a string in all the files within a specific directory as follows **grep -rnw ' |
</ | </ | ||
- | Download | + | Make the following |
- | <file - greptest> | + | <code> |
+ | [root@centos8 tmp]# vi greptest | ||
+ | [root@centos8 tmp]# cat greptest | ||
# Starting comment | # Starting comment | ||
fenestrOS | fenestrOS | ||
Ligne 1390: | Ligne 1493: | ||
£ | £ | ||
# End comment | # End comment | ||
- | </ | ||
- | |||
- | Move the file to the **/tmp** directory: | ||
- | |||
- | < | ||
- | [root@centos7 ~]# mv / | ||
</ | </ | ||
Ligne 1401: | Ligne 1498: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
fenestrOS | fenestrOS | ||
fenestros | fenestros | ||
Ligne 1412: | Ligne 1509: | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | The expression **' | + | **Important** - The expression **' |
</ | </ | ||
Ligne 1418: | Ligne 1515: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 | + | [root@centos8 |
fenestrOS | fenestrOS | ||
fenestros | fenestros | ||
Ligne 1433: | Ligne 1530: | ||
</ | </ | ||
- | Download | + | Make the following |
- | <file text greptest> | + | <code> |
+ | [root@centos8 tmp]# vi greptest | ||
+ | [root@centos8 tmp]# cat greptest | ||
# Starting comment | # Starting comment | ||
^ This line will be used to demonstrate the use of fgrep | ^ This line will be used to demonstrate the use of fgrep | ||
Ligne 1450: | Ligne 1549: | ||
£ | £ | ||
# End comment | # End comment | ||
- | </ | ||
- | |||
- | Move the file to the **/tmp** directory: | ||
- | |||
- | < | ||
- | [root@centos7 ~]# mv / | ||
</ | </ | ||
Ligne 1461: | Ligne 1554: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
^ This line will be used to demonstrate the use of fgrep | ^ This line will be used to demonstrate the use of fgrep | ||
</ | </ | ||
Ligne 1468: | Ligne 1561: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
# Starting comment | # Starting comment | ||
^ This line will be used to demonstrate the use of fgrep | ^ This line will be used to demonstrate the use of fgrep | ||
Ligne 1488: | Ligne 1581: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
^ This line will be used to demonstrate the use of fgrep | ^ This line will be used to demonstrate the use of fgrep | ||
</ | </ | ||
Ligne 1523: | Ligne 1616: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **fgrep** command to view the command line switches. | **To do** : Use the **--help** option of the **fgrep** command to view the command line switches. | ||
</ | </ | ||
- | ===LAB #2 - Using sed=== | + | ===LAB #5 - Using sed=== |
Start by displaying the contents of the file **/ | Start by displaying the contents of the file **/ | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
# are included, only the more common ones. | # are included, only the more common ones. | ||
# | # | ||
Ligne 1556: | Ligne 1649: | ||
systat | systat | ||
daytime | daytime | ||
- | --More-- | + | --Plus-- |
</ | </ | ||
Ligne 1562: | Ligne 1655: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
tcpmux | tcpmux | ||
Ligne 1586: | Ligne 1679: | ||
ftp | ftp | ||
ftp | ftp | ||
- | --More-- | + | --Plus-- |
</ | </ | ||
Ligne 1596: | Ligne 1689: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
root: | root: | ||
root: | root: | ||
Ligne 1614: | Ligne 1707: | ||
< | < | ||
- | [root@centos7 | + | < |
+ | [root@centos8 | ||
root: | root: | ||
bin: | bin: | ||
Ligne 1622: | Ligne 1716: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 | + | [root@centos8 |
tcpmux | tcpmux | ||
Ligne 1647: | Ligne 1741: | ||
ftp | ftp | ||
ftp | ftp | ||
- | --More--(0%) | + | --Plus--(0%) |
</ | </ | ||
Ligne 1657: | Ligne 1751: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 | + | [root@centos8 |
user1 user2 user3 | user1 user2 user3 | ||
</ | </ | ||
Ligne 1690: | Ligne 1784: | ||
< | < | ||
- | [root@centos7 ~]# ls -l | awk ' | + | [root@centos8 tmp]# ls -l | awk ' |
- | 2015rootroot | + | 05: |
- | 19:09270users | + | 05:21rootroot |
- | 2015rootroot | + | 05: |
- | 2015rootroot | + | 05: |
+ | 12: | ||
</ | </ | ||
Ligne 1703: | Ligne 1798: | ||
< | < | ||
- | [root@centos7 ~]# ls -l | awk ' | + | [root@centos8 tmp]# ls -l | awk ' |
| | ||
- | 2015 root root | + | 05:23 root root |
- | 19:09 270 users | + | 05:21 root root |
- | 2015 root root | + | 05:28 root root |
- | 2015 root root | + | 05:29 root root |
+ | 12:05 root root | ||
</ | </ | ||
Ligne 1794: | Ligne 1890: | ||
< | < | ||
- | [root@centos7 ~]# cat > awkscript | + | [root@centos8 tmp]# cat > scriptawk |
BEGIN { | BEGIN { | ||
- | print "List of the currently mounted file systems"} | + | print "Liste des systèmes de fichiers montés"} |
{print $0} | {print $0} | ||
END { | END { | ||
- | print "==========================================" | + | print " |
[^D] | [^D] | ||
</ | </ | ||
Ligne 1806: | Ligne 1902: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
Liste des systèmes de fichiers montés | Liste des systèmes de fichiers montés | ||
- | + | sysfs /sys sysfs rw, | |
- | # | + | proc /proc proc rw, |
- | # /etc/fstab | + | devtmpfs |
- | # Created by anaconda on Sun Mar 8 12:38:10 2015 | + | securityfs / |
- | # | + | tmpfs /dev/shm tmpfs rw, |
- | # Accessible filesystems, by reference, are maintained under '/dev/disk' | + | devpts /dev/pts devpts rw, |
- | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info | + | tmpfs /run tmpfs rw, |
- | # | + | tmpfs / |
- | UUID=b35de665-5ec8-4226-a533-58a1b567ac91 | + | cgroup / |
- | UUID=e8d3bd48-1386-411c-9675-41c3f8f1a309 | + | pstore / |
- | UUID=11a4d11d-81e4-46a7-82e0-7796cd597dc9 swap swap defaults | + | bpf /sys/fs/bpf bpf rw, |
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | cgroup / | ||
+ | none / | ||
+ | configfs / | ||
+ | / | ||
+ | selinuxfs / | ||
+ | systemd-1 / | ||
+ | debugfs / | ||
+ | hugetlbfs / | ||
+ | mqueue /dev/mqueue mqueue rw, | ||
+ | / | ||
+ | sunrpc / | ||
+ | tmpfs / | ||
+ | binfmt_misc / | ||
+ | tracefs / | ||
===================================== | ===================================== | ||
</ | </ | ||
Ligne 1937: | Ligne 2057: | ||
===Command Line Switches=== | ===Command Line Switches=== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **awk** command to view the command line switches. | **To do** : Use the **--help** option of the **awk** command to view the command line switches. | ||
</ | </ | ||
- | ===LAB #3 - Using awk=== | + | ===LAB #6 - Using awk=== |
- | Download | + | Create |
- | <file text sales.txt> | + | <code> |
- | # FenestrOs.com | + | [root@centos8 tmp]# vi sales.txt |
+ | [root@centos8 tmp]# cat sales.txt | ||
# Annual sales by French department | # Annual sales by French department | ||
# 83 | # 83 | ||
Ligne 1965: | Ligne 2086: | ||
Servers§12 | Servers§12 | ||
Ipads§56 | Ipads§56 | ||
- | </file> | + | </code> |
- | Now download | + | Now create |
- | <file text sales.awk> | + | <code> |
+ | [root@centos8 tmp]# vi sales.awk | ||
+ | [root@centos8 tmp]# cat sales.awk | ||
# BEGIN | # BEGIN | ||
BEGIN { | BEGIN { | ||
Ligne 1983: | Ligne 2106: | ||
printf(" | printf(" | ||
} | } | ||
- | </file> | + | </code> |
This script contains 13 lines. The purpose of this script is to calculate the total number of computers sold in the three French departments from the data present in the **sales** file: | This script contains 13 lines. The purpose of this script is to calculate the total number of computers sold in the three French departments from the data present in the **sales** file: | ||
Ligne 2017: | Ligne 2140: | ||
< | < | ||
- | [root@centos7 ~]# awk -f /home/ | + | [root@centos8 tmp]# awk -f /tmp/sales.awk /tmp/sales.txt |
PC Type : Portables Sales (06+13+83) : 175 | PC Type : Portables Sales (06+13+83) : 175 | ||
- | PC Type : Ipads Sales (06+13+83) : 76 | + | PC Type : Ipads Sales (06+13+83) : 76 |
PC Type : Desktops Sales (06+13+83) : 329 | PC Type : Desktops Sales (06+13+83) : 329 | ||
- | PC Type : Servers | + | PC Type : Servers |
</ | </ | ||
- | ====Other Useful Commands==== | + | ====LAB #7 - Other Useful Commands==== |
- | ===The expand Command=== | + | ===7.1 - The expand Command=== |
The **expand** command converts tabulations in a file to spaces and prints the results to STDOUT. With no file as an argument or with the **-** character as an argument, the command takes it's input from STDIN. | The **expand** command converts tabulations in a file to spaces and prints the results to STDOUT. With no file as an argument or with the **-** character as an argument, the command takes it's input from STDIN. | ||
- | Download | + | Create |
- | + | ||
- | <file text expand.txt> | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | un deux trois quatre cinq | + | |
- | </ | + | |
- | + | ||
- | Move the file to the /root folder: | + | |
- | + | ||
- | < | + | |
- | [root@centos7 ~]# mv / | + | |
- | </ | + | |
- | + | ||
- | Use the **cat** command to view the contents of the file: | + | |
< | < | ||
- | [root@centos7 ~]# cat expand | + | [root@centos8 tmp]# vi expand |
+ | [root@centos8 tmp]# cat expand | ||
un deux trois quatre cinq | un deux trois quatre cinq | ||
un deux trois quatre cinq | un deux trois quatre cinq | ||
Ligne 2065: | Ligne 2168: | ||
un deux trois quatre cinq | un deux trois quatre cinq | ||
un deux trois quatre cinq | un deux trois quatre cinq | ||
- | </ | + | </code>> |
Now use the **-vet** switches of the **cat** command to view the non-printable characters: | Now use the **-vet** switches of the **cat** command to view the non-printable characters: | ||
< | < | ||
- | [root@centos7 ~]# cat -vet expand | + | [root@centos8 tmp]# cat -vet expand |
un^Ideux^Itrois^Iquatre^Icinq$ | un^Ideux^Itrois^Iquatre^Icinq$ | ||
un^Ideux^Itrois^Iquatre^Icinq$ | un^Ideux^Itrois^Iquatre^Icinq$ | ||
Ligne 2090: | Ligne 2193: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
</ | </ | ||
Ligne 2096: | Ligne 2199: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
un deux trois | un deux trois | ||
un deux trois | un deux trois | ||
Ligne 2115: | Ligne 2218: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **expand** command to view the command line switches. | **To do** : Use the **--help** option of the **expand** command to view the command line switches. | ||
</ | </ | ||
- | ===La Commande | + | ===7.2 - The unexpand |
The **expand** command converts spaces in a file to tabulations and prints the results to STDOUT. With no file as an argument or with the **-** character as an argument, the command takes it's input from STDIN. | The **expand** command converts spaces in a file to tabulations and prints the results to STDOUT. With no file as an argument or with the **-** character as an argument, the command takes it's input from STDIN. | ||
Ligne 2126: | Ligne 2229: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
un deux trois | un deux trois | ||
un deux trois | un deux trois | ||
Ligne 2137: | Ligne 2240: | ||
un deux trois | un deux trois | ||
un deux trois | un deux trois | ||
- | [root@centos7 | + | |
- | [root@centos7 | + | [root@centos8 |
+ | |||
+ | [root@centos8 | ||
un^Ideux^Itrois^Iquatre^Icinq$ | un^Ideux^Itrois^Iquatre^Icinq$ | ||
un^Ideux^Itrois^Iquatre^Icinq$ | un^Ideux^Itrois^Iquatre^Icinq$ | ||
Ligne 2157: | Ligne 2262: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **unexpand** command to view the command line switches. | **To do** : Use the **--help** option of the **unexpand** command to view the command line switches. | ||
</ | </ | ||
- | ===The cut command=== | + | ===7.3 - The cut Command=== |
The cut command splits each line of a file into columns starting with column 1. Each column contains one character. The command can also be used to split lines into fields where the default seperator is a tablulation. The default seperator can be changed by using the **-d** switch. | The cut command splits each line of a file into columns starting with column 1. Each column contains one character. The command can also be used to split lines into fields where the default seperator is a tablulation. The default seperator can be changed by using the **-d** switch. | ||
Ligne 2168: | Ligne 2273: | ||
< | < | ||
- | [root@centos7 ~]# cut -c1-7 /etc/passwd | + | [root@centos8 tmp]# cut -c1-7 /etc/passwd |
root:x: | root:x: | ||
bin:x:1 | bin:x:1 | ||
Ligne 2183: | Ligne 2288: | ||
nobody: | nobody: | ||
dbus:x: | dbus:x: | ||
+ | systemd | ||
+ | systemd | ||
+ | tss:x:5 | ||
polkitd | polkitd | ||
unbound | unbound | ||
- | colord: | ||
- | usbmuxd | ||
- | avahi:x | ||
- | avahi-a | ||
- | saslaut | ||
- | qemu:x: | ||
libstor | libstor | ||
- | rpc:x:3 | + | cockpit |
- | rpcuser | + | sssd:x: |
- | nfsnobo | + | setroub |
- | rtkit:x | + | |
- | radvd:x | + | |
- | ntp:x:3 | + | |
- | chrony: | + | |
- | abrt:x: | + | |
- | pulse:x | + | |
- | gdm:x:4 | + | |
- | gnome-i | + | |
- | postfix | + | |
sshd:x: | sshd:x: | ||
+ | chrony: | ||
tcpdump | tcpdump | ||
trainee | trainee | ||
- | vboxadd | + | cockpit |
- | tss:x:5 | + | rngd:x: |
+ | gluster | ||
+ | qemu:x: | ||
+ | rpc:x:3 | ||
+ | rpcuser | ||
+ | saslaut | ||
+ | radvd:x | ||
+ | dnsmasq | ||
</ | </ | ||
Ligne 2214: | Ligne 2315: | ||
< | < | ||
- | [root@centos7 ~]# cut -c1-5, | + | [root@centos8 tmp]# cut -c1-5, |
root: | root: | ||
bin: | bin: | ||
Ligne 2227: | Ligne 2328: | ||
games2: | games2: | ||
ftp: | ftp: | ||
- | nobod99:99:/nologin | + | nobod65534:verflow User:/:/sbin/nologin |
dbus:: | dbus:: | ||
- | polki: | + | systeoredumstemd Core Dumper:/:/ |
- | unbou:998:9 resolver:/etc/unbound:/ | + | systeesolvetemd Resolver:/:/ |
- | color997:99ord:/ | + | tss:x59:Acche trousers package to sandbox the tcsd daemon:/dev/null:/ |
- | usbmu: | + | polki:998:9lkitd:/:/ |
- | avahi0:70:ASD Stack:/var/ | + | unbou:997:9 resolver:/etc/unbound:/ |
- | avahioipd:x IPv4LL Stack:/ | + | |
- | saslax: | + | |
- | qemu: | + | |
libstemgmt: | libstemgmt: | ||
- | rpc: | + | cockps:x:99 cockpit-ws:/nonexisting:/ |
- | rpcus: | + | sssd:4:990:/:/ |
- | nfsno:x:655mous NFS User:/var/lib/nfs:/ | + | setroshoot:r/lib/setroubleshoot:/ |
- | rtkit72:172proc:/ | + | |
- | radvd5:75:rbin/nologin | + | |
- | ntp: | + | |
- | chron994: | + | |
- | abrt:3:173:in/nologin | + | |
- | pulse71: | + | |
- | gdm: | + | |
- | gnometial-s::/ | + | |
- | postf: | + | |
sshd:: | sshd:: | ||
+ | chron992: | ||
tcpdu: | tcpdu: | ||
train: | train: | ||
- | vboxa:992:1xadd:/bin/false | + | cockpsinstaUser for cockpit-ws instances:/ |
- | tss:x59:Acche trousers package to sandbox the tcsd daemon:/dev/null:/ | + | rngd: |
+ | glust: | ||
+ | qemu:7:107:bin/nologin | ||
+ | rpc:x32:Rpcar/ | ||
+ | rpcus: | ||
+ | saslax: | ||
+ | radvd5: | ||
+ | dnsma: | ||
</ | </ | ||
Ligne 2260: | Ligne 2357: | ||
< | < | ||
- | [root@centos7 ~]# cut -d: -f2,4,6 /etc/passwd | + | [root@centos8 tmp]# cut -d: -f2,4,6 /etc/passwd |
x:0:/root | x:0:/root | ||
x:1:/bin | x:1:/bin | ||
Ligne 2273: | Ligne 2370: | ||
x: | x: | ||
x: | x: | ||
- | x:99:/ | + | x:65534:/ |
x:81:/ | x:81:/ | ||
- | x:998:/ | + | x:997:/ |
- | x:997:/ | + | x:193:/ |
- | x:996:/var/lib/colord | + | x: |
- | x:113:/ | + | x:996:/ |
- | x:70:/var/run/avahi-daemon | + | x:994:/ |
- | x:170:/var/lib/avahi-autoipd | + | x:993:/ |
- | x:76:/run/saslauthd | + | x: |
+ | x:990:/ | ||
+ | x:989:/var/lib/setroubleshoot | ||
+ | x:74:/var/ | ||
+ | x:988:/var/lib/ | ||
+ | x:72:/ | ||
+ | x: | ||
+ | x:987:/nonexisting | ||
+ | x:986:/var/lib/rngd | ||
+ | x:985:/run/gluster | ||
x:107:/ | x:107:/ | ||
- | x: | ||
x: | x: | ||
x: | x: | ||
- | x:65534:/var/lib/nfs | + | x:76:/run/saslauthd |
- | x:172:/proc | + | |
x:75:/ | x:75:/ | ||
- | x:38:/ | + | x:983:/var/lib/dnsmasq |
- | x:993:/var/lib/chrony | + | |
- | x: | + | |
- | x: | + | |
- | x: | + | |
- | x: | + | |
- | x: | + | |
- | x: | + | |
- | x:72:/ | + | |
- | x: | + | |
- | x: | + | |
- | x: | + | |
</ | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | **Important**: | ||
- | </ | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **cut** command to view the command line switches. | **To do** : Use the **--help** option of the **cut** command to view the command line switches. | ||
</ | </ | ||
- | ===The uniq Command=== | + | ===7.4 - The uniq Command=== |
The following command is used to extract the Primary Group GIDs from the **/ | The following command is used to extract the Primary Group GIDs from the **/ | ||
< | < | ||
- | [root@centos7 ~]# cut -d: -f4 /etc/passwd | sort -n | uniq | + | [root@centos8 tmp]# cut -d: -f4 /etc/passwd | sort -n | uniq |
0 | 0 | ||
1 | 1 | ||
Ligne 2327: | Ligne 2416: | ||
29 | 29 | ||
32 | 32 | ||
- | 38 | ||
- | 42 | ||
50 | 50 | ||
59 | 59 | ||
- | 70 | ||
72 | 72 | ||
74 | 74 | ||
Ligne 2337: | Ligne 2423: | ||
76 | 76 | ||
81 | 81 | ||
- | 89 | ||
- | 99 | ||
100 | 100 | ||
107 | 107 | ||
- | 113 | + | 193 |
- | 170 | + | 983 |
- | 171 | + | 985 |
- | 172 | + | 986 |
- | 173 | + | 987 |
+ | 988 | ||
+ | 989 | ||
+ | 990 | ||
991 | 991 | ||
993 | 993 | ||
Ligne 2351: | Ligne 2438: | ||
996 | 996 | ||
997 | 997 | ||
- | 998 | ||
1000 | 1000 | ||
65534 | 65534 | ||
Ligne 2362: | Ligne 2448: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **uniq** command to view the command line switches. | **To do** : Use the **--help** option of the **uniq** command to view the command line switches. | ||
</ | </ | ||
- | ===The tr Command=== | + | ===7.5 - The tr Command=== |
The **tr** command is used to substitute certain characters by other characters. This command **only** accepts data from standard input (hence the pipe): | The **tr** command is used to substitute certain characters by other characters. This command **only** accepts data from standard input (hence the pipe): | ||
< | < | ||
- | [root@centos7 ~]# cat /etc/passwd | tr " | + | [root@centos8 tmp]# cat /etc/passwd | tr " |
ROOT: | ROOT: | ||
BIN: | BIN: | ||
Ligne 2384: | Ligne 2470: | ||
GAMES: | GAMES: | ||
FTP: | FTP: | ||
- | NOBODY:X:99:99:NOBODY:/:/ | + | NOBODY:X:65534:65534:KERNEL OVERFLOW USER:/:/ |
DBUS: | DBUS: | ||
- | POLKITD: | + | SYSTEMD-COREDUMP:X:999: |
- | UNBOUND:X:998:997:UNBOUND DNS RESOLVER:/ | + | SYSTEMD-RESOLVE: |
- | COLORD:X:997:996:USER FOR COLORD:/VAR/LIB/COLORD:/ | + | TSS: |
- | USBMUXD:X:113:113:USBMUXD | + | POLKITD:X:998:996:USER FOR POLKITD:/:/ |
- | AVAHI:X:70:70:AVAHI MDNS/DNS-SD STACK:/VAR/RUN/AVAHI-DAEMON:/ | + | UNBOUND:X:997:994:UNBOUND DNS RESOLVER:/ |
- | AVAHI-AUTOIPD:X:170:170:AVAHI IPV4LL STACK:/VAR/LIB/AVAHI-AUTOIPD:/ | + | LIBSTORAGEMGMT:X:996:993:DAEMON ACCOUNT |
- | SASLAUTH:X:996:76:" | + | COCKPIT-WS:X:995:991:USER FOR COCKPIT-WS:/NONEXISTING:/ |
+ | SSSD:X:994:990:USER FOR SSSD:/:/ | ||
+ | SETROUBLESHOOT: | ||
+ | SSHD: | ||
+ | CHRONY:X:992:988::/VAR/LIB/CHRONY:/ | ||
+ | TCPDUMP:X:72:72::/:/ | ||
+ | TRAINEE: | ||
+ | COCKPIT-WSINSTANCE: | ||
+ | RNGD: | ||
+ | GLUSTER: | ||
QEMU: | QEMU: | ||
- | LIBSTORAGEMGMT: | ||
RPC: | RPC: | ||
RPCUSER: | RPCUSER: | ||
- | NFSNOBODY:X:65534:65534:ANONYMOUS NFS USER:/VAR/LIB/ | + | SASLAUTH:X:988:76:SASLAUTHD |
- | RTKIT: | + | |
RADVD: | RADVD: | ||
- | NTP:X:38:38::/ | + | DNSMASQ:X:983:983:DNSMASQ DHCP AND DNS SERVER:/VAR/LIB/DNSMASQ:/ |
- | CHRONY: | + | |
- | ABRT: | + | |
- | PULSE: | + | |
- | GDM: | + | |
- | GNOME-INITIAL-SETUP: | + | |
- | POSTFIX: | + | |
- | SSHD: | + | |
- | TCPDUMP: | + | |
- | TRAINEE: | + | |
- | VBOXADD: | + | |
- | TSS: | + | |
</ | </ | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **tr** command to view the command line switches. | **To do** : Use the **--help** option of the **tr** command to view the command line switches. | ||
</ | </ | ||
- | ===The paste Command=== | + | ===7.6 - The paste Command=== |
The **paste** command concatenates lines from n files. For example: | The **paste** command concatenates lines from n files. For example: | ||
< | < | ||
- | [root@centos7 ~]# paste -d: /etc/passwd / | + | [root@centos8 tmp]# paste -d: /etc/passwd / |
- | root: | + | root: |
- | bin: | + | bin: |
- | daemon: | + | daemon: |
- | adm: | + | adm: |
- | lp: | + | lp: |
- | sync: | + | sync: |
- | shutdown: | + | shutdown: |
- | halt: | + | halt: |
- | mail: | + | mail: |
- | operator: | + | operator: |
- | games: | + | games: |
- | ftp: | + | ftp: |
- | nobody:x:99:99:Nobody:/:/ | + | nobody:x:65534:65534:Kernel Overflow User:/:/ |
- | dbus: | + | dbus: |
- | polkitd:x:999:998:User for polkitd:/:/ | + | systemd-coredump:x:999:997:systemd Core Dumper:/:/ |
- | unbound:x:998:997:Unbound DNS resolver:/etc/unbound:/ | + | systemd-resolve:x:193:193:systemd Resolver:/:/ |
- | colord:x:997:996:User for colord:/var/lib/colord:/ | + | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ |
- | usbmuxd:x:113:113:usbmuxd user:/:/ | + | polkitd:x:998:996:User for polkitd:/:/ |
- | avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/ | + | unbound:x:997:994:Unbound |
- | avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/ | + | libstoragemgmt:x:996:993:daemon account for libstoragemgmt:/var/run/lsm:/ |
- | saslauth: | + | cockpit-ws:x:995:991:User for cockpit-ws:/nonexisting:/ |
- | qemu:x:107:107:qemu user:/:/ | + | sssd:x:994:990: |
- | libstoragemgmt:x:995:994:daemon account | + | setroubleshoot:x:993:989::/var/lib/setroubleshoot:/ |
- | rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/ | + | sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/ |
- | rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/ | + | chrony:x:992:988::/var/lib/chrony:/ |
- | nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/ | + | tcpdump:x:72:72::/:/ |
- | rtkit:x:172:172:RealtimeKit:/proc:/ | + | trainee:x:1000:1000:trainee:/home/ |
- | radvd:x:75:75:radvd user:/:/sbin/nologin:radvd:!!:16502:::::: | + | cockpit-wsinstance:x:991:987:User for cockpit-ws instances:/nonexisting:/ |
- | ntp:x:38:38::/etc/ntp:/ | + | rngd:x:990:986:Random Number Generator Daemon:/var/lib/rngd:/ |
- | chrony:x:994:993::/var/lib/chrony:/ | + | gluster:x:989:985:GlusterFS daemons:/run/gluster:/ |
- | abrt:x:173:173::/etc/abrt:/ | + | qemu:x:107:107:qemu user:/:/ |
- | pulse:x:171:171:PulseAudio System Daemon:/var/ | + | rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/ |
- | gdm:x:42:42::/var/lib/gdm:/ | + | rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/ |
- | gnome-initial-setup:x:993:991::/ | + | saslauth:x:988:76:Saslauthd user:/run/saslauthd:/ |
- | postfix: | + | radvd:x:75:75:radvd user:/:/ |
- | sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/ | + | dnsmasq:x:983:983:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/ |
- | tcpdump:x:72:72::/:/ | + | |
- | trainee:x:1000:1000: | + | |
- | vboxadd: | + | |
- | tss: | + | |
</ | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | **Important**: | ||
- | </ | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **paste** command to view the command line switches. | **To do** : Use the **--help** option of the **paste** command to view the command line switches. | ||
</ | </ | ||
- | ===The split Command=== | + | ===7.7 - The split Command=== |
The split command is used to divide a large file into smaller segments. Create an empty 250 MB file as follows: | The split command is used to divide a large file into smaller segments. Create an empty 250 MB file as follows: | ||
< | < | ||
- | [root@centos7 ~]# dd if=/ | + | [root@centos8 tmp]# dd if=/ |
250+0 records in | 250+0 records in | ||
250+0 records out | 250+0 records out | ||
- | 262144000 bytes (262 MB) copied, 0.215447 | + | 262144000 bytes (262 MB, 250 MiB) copied, 0.143522 |
- | </ | + | </ |
Now use the split command to divide the file into 5 smaller files each of 50: | Now use the split command to divide the file into 5 smaller files each of 50: | ||
< | < | ||
- | [root@centos7 ~]# split -b 50m /file filepart | + | [root@centos8 tmp]# split -b 50m /file filepart |
- | [root@centos7 ~]# ls -l | grep filepart | + | [root@centos8 tmp]# ls -l | grep filepart |
- | -rw-r--r--. | + | -rw-r--r--. 1 root root 52428800 |
- | -rw-r--r--. | + | -rw-r--r--. 1 root root 52428800 |
- | -rw-r--r--. | + | -rw-r--r--. 1 root root 52428800 |
- | -rw-r--r--. | + | -rw-r--r--. 1 root root 52428800 |
- | -rw-r--r--. | + | -rw-r--r--. 1 root root 52428800 |
</ | </ | ||
Ligne 2508: | Ligne 2582: | ||
< | < | ||
- | [root@centos7 ~]# cat fileparta* > newfile | + | [root@centos8 tmp]# cat fileparta* > newfile |
- | [root@centos7 ~]# ls -l | grep newf | + | [root@centos8 tmp]# ls -l | grep newf |
- | -rw-r--r--. | + | -rw-r--r--. 1 root root 262144000 |
+ | [root@centos8 tmp]# ls -l / | grep file | ||
+ | -rw-r--r--. | ||
</ | </ | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **split** command to view the command line switches. | **To do** : Use the **--help** option of the **split** command to view the command line switches. | ||
</ | </ | ||
- | ===The diff Command=== | + | ===7.8 - The diff Command=== |
The diff command compares two fles and indicates what changes need to be made to the first file in order that it be identical to the second file. | The diff command compares two fles and indicates what changes need to be made to the first file in order that it be identical to the second file. | ||
Ligne 2526: | Ligne 2602: | ||
< | < | ||
- | [root@centos | + | [root@centos8 |
</ | </ | ||
Ligne 2541: | Ligne 2617: | ||
< | < | ||
... | ... | ||
- | Linux is great! | + | Linux est super! |
</ | </ | ||
Ligne 2547: | Ligne 2623: | ||
< | < | ||
- | [root@centos7 ~]# diff /etc/passwd / | + | [root@centos8 tmp]# diff /etc/passwd / |
- | 38,39c38 | + | 26,27c26 |
+ | < tcpdump: | ||
< trainee: | < trainee: | ||
- | < vboxadd: | ||
--- | --- | ||
> trainee10: | > trainee10: | ||
- | 40a40 | + | 36a36 |
- | > Linux is great! | + | > Linux est super! |
</ | </ | ||
In this output you will notice the **<** and **>** characters. The first makes reference to the first file, / | In this output you will notice the **<** and **>** characters. The first makes reference to the first file, / | ||
- | The output **38,39c38** means that line 39 needs to be changed in /etc/passwd so that is the same as line 38 in / | + | The output **26,27c26** means that line 27 needs to be changed in /etc/passwd so that is the same as line 26 in / |
- | The output **40a40** means that at line 40 in /etc/passwd line 40 from / | + | The output **36a36** means that at line 36 in /etc/passwd line 36 from / |
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **diff** command to view the command line switches. | **To do** : Use the **--help** option of the **diff** command to view the command line switches. | ||
</ | </ | ||
- | ===The cmp Command=== | + | ===7.9 - The cmp Command=== |
The **cmp** command compares two files character by character. By default, the command stops after finding the first difference: | The **cmp** command compares two files character by character. By default, the command stops after finding the first difference: | ||
< | < | ||
- | [root@centos7 ~]# cmp / | + | [root@centos8 tmp]# cmp / |
- | / | + | / |
</ | </ | ||
Ligne 2581: | Ligne 2657: | ||
< | < | ||
- | [root@centos7 ~]# cmp -l / | + | [root@centos8 tmp]# cmp -l / |
- | cmp: EOF on / | + | cmp: EOF on / |
- | 1873 | + | 1300 162 143 |
- | 1874 60 170 | + | 1301 141 160 |
- | 1876 170 | + | 1302 151 144 |
- | 1877 | + | 1303 156 165 |
- | 1878 | + | 1304 145 155 |
- | 1880 | + | 1305 145 160 |
- | 1881 | + | 1306 |
- | 1882 | + | 1307 60 170 |
- | 1883 | + | 1309 170 |
- | 1885 | + | 1310 |
- | 1886 | + | 1311 |
- | 1887 72 162 | + | 1312 |
- | 1888 164 141 | + | 1313 |
- | 1889 162 151 | + | 1314 60 72 |
- | 1890 141 156 | + | 1316 |
- | 1891 151 145 | + | 1317 |
- | 1892 156 145 | + | 1318 |
- | 1893 145 72 | + | 1319 60 163 |
- | 1894 145 57 | + | 1320 |
- | 1895 | + | 1321 164 151 |
- | 1896 57 157 | + | 1322 162 156 |
- | 1897 150 155 | + | 1323 141 57 |
- | 1898 157 145 | + | 1324 151 156 |
- | 1899 155 57 | + | |
- | 1900 145 164 | + | |
- | 1901 57 162 | + | |
- | 1902 164 141 | + | |
- | 1903 162 151 | + | |
--More-- | --More-- | ||
</ | </ | ||
Ligne 2618: | Ligne 2689: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **cmp** command to view the command line switches. | **To do** : Use the **--help** option of the **cmp** command to view the command line switches. | ||
</ | </ | ||
- | ===The patch Command=== | + | ===7.10 - The patch Command=== |
- | The **patch** command is used to apply modifications contained within a patch file to an older version of a file so that it becomes the newer version of the file. | + | La commande **patch** est utilisée pour appliquer des modifications à un fichier à partir d'un fichier patch qui contient les The **patch** command is used to apply modifications contained within a patch file to an older version of a file so that it becomes the newer version of the file. |
- | The **patch** command is not installed by default in RHEL/ | + | The **patch** command is not installed by default in RHEL/ |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Loaded plugins: fastestmirror, | + | |
- | Loading mirror speeds from cached hostfile | + | |
- | * base: mirror.ibcp.fr | + | |
- | * extras: mirrors.atosworldline.com | + | |
- | * updates: mirror.ibcp.fr | + | |
- | Resolving Dependencies | + | |
- | --> Running transaction check | + | |
- | ---> Package patch.x86_64 0: | + | |
- | --> Finished Dependency Resolution | + | |
- | + | ||
- | Dependencies Resolved | + | |
- | + | ||
- | ====================================================================================================================================================== | + | |
- | | + | |
- | ====================================================================================================================================================== | + | |
- | Installing: | + | |
- | | + | |
- | + | ||
- | Transaction Summary | + | |
- | ====================================================================================================================================================== | + | |
- | Install | + | |
- | + | ||
- | Total download size: 110 k | + | |
- | Installed size: 210 k | + | |
- | Is this ok [y/d/N]: y | + | |
- | Downloading packages: | + | |
- | patch-2.7.1-8.el7.x86_64.rpm | + | |
- | Running transaction check | + | |
- | Running transaction test | + | |
- | Transaction test succeeded | + | |
- | Running transaction | + | |
- | Installing : patch-2.7.1-8.el7.x86_64 | + | |
- | Verifying | + | |
- | + | ||
- | Installed: | + | |
- | patch.x86_64 0: | + | |
- | + | ||
- | Complete! | + | |
</ | </ | ||
- | If you recall, you made some changes to the original **greptest** file that you downloaded: | + | If you recall, you made some changes to the /tmp/greptest |
< | < | ||
- | [root@centos7 ~]# cat / | + | [root@centos8 tmp]# cat / |
# Starting comment | # Starting comment | ||
^ This line will be used to demonstrate the use of fgrep | ^ This line will be used to demonstrate the use of fgrep | ||
Ligne 2688: | Ligne 2721: | ||
£ | £ | ||
# End comment | # End comment | ||
- | </ | + | [root@centos8 tmp]# cat / |
- | + | ||
- | You also used egrep to remove all the comments and empty lines and save the result to **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos ~]# cat / | + | |
fenestrOS | fenestrOS | ||
fenestros | fenestros | ||
Ligne 2706: | Ligne 2734: | ||
< | < | ||
- | [root@centos7 ~]# cd /tmp | + | [root@centos8 |
- | [root@centos7 | + | |
</ | </ | ||
Ligne 2713: | Ligne 2740: | ||
< | < | ||
- | [root@centos | + | [root@centos8 |
- | --- greptest 2013-01-07 15:14:03.646565259 +0100 | + | --- greptest 2021-04-20 05:23:52.710188632 -0400 |
- | +++ greptest1 2013-01-07 15:07:05.657375635 +0100 | + | +++ greptest1 2021-04-20 05:21:55.189882834 -0400 |
@@ -1,14 +1,7 @@ | @@ -1,14 +1,7 @@ | ||
-# Starting comment | -# Starting comment | ||
Ligne 2736: | Ligne 2763: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
patching file greptest | patching file greptest | ||
</ | </ | ||
Ligne 2743: | Ligne 2770: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
fenestrOS | fenestrOS | ||
fenestros | fenestros | ||
Ligne 2755: | Ligne 2782: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **patch** command to view the command line switches. | **To do** : Use the **--help** option of the **patch** command to view the command line switches. | ||
</ | </ | ||
- | ===The strings Command=== | + | ===7.11 - The strings Command=== |
The **strings** Command is used to extract any printable string in one or more object files or executables. An object fie is an intermediary file used when compiling. | The **strings** Command is used to extract any printable string in one or more object files or executables. An object fie is an intermediary file used when compiling. | ||
Ligne 2772: | Ligne 2799: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
/ | / | ||
- | {1~` | ||
libuser.so.1 | libuser.so.1 | ||
g_value_get_int64 | g_value_get_int64 | ||
Ligne 2781: | Ligne 2807: | ||
g_free | g_free | ||
g_value_array_get_nth | g_value_array_get_nth | ||
+ | audit_open | ||
__gmon_start__ | __gmon_start__ | ||
g_value_get_string | g_value_get_string | ||
g_type_check_value_holds | g_type_check_value_holds | ||
g_value_get_long | g_value_get_long | ||
- | _Jv_RegisterClasses | ||
freecon | freecon | ||
+ | audit_log_acct_message | ||
_ITM_registerTMCloneTable | _ITM_registerTMCloneTable | ||
lu_ent_set_string | lu_ent_set_string | ||
Ligne 2792: | Ligne 2819: | ||
lu_error_free | lu_error_free | ||
lu_user_lock | lu_user_lock | ||
- | _fini | ||
- | _init | ||
lu_strerror | lu_strerror | ||
lu_ent_free | lu_ent_free | ||
lu_ent_new | lu_ent_new | ||
lu_user_modify | lu_user_modify | ||
- | lu_prompt_console | ||
- | lu_start | ||
- | lu_user_lookup_name | ||
--More-- | --More-- | ||
</ | </ | ||
Ligne 2807: | Ligne 2829: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | | + | |
- | 648 {1~` | + | 2809 libuser.so.1 |
- | 2833 libuser.so.1 | + | 2822 g_value_get_int64 |
- | 2846 g_value_get_int64 | + | 2840 is_selinux_enabled |
- | 2864 is_selinux_enabled | + | 2859 _ITM_deregisterTMCloneTable |
- | 2883 _ITM_deregisterTMCloneTable | + | 2887 g_free |
- | 2911 g_free | + | 2894 g_value_array_get_nth |
- | 2918 g_value_array_get_nth | + | 2916 audit_open |
- | 2940 __gmon_start__ | + | |
- | 2955 g_value_get_string | + | 2942 g_value_get_string |
- | 2974 g_type_check_value_holds | + | 2961 g_type_check_value_holds |
- | 2999 g_value_get_long | + | 2986 g_value_get_long |
- | 3016 _Jv_RegisterClasses | + | 3003 freecon |
- | 3036 freecon | + | 3011 audit_log_acct_message |
- | 3044 _ITM_registerTMCloneTable | + | 3034 _ITM_registerTMCloneTable |
- | 3070 lu_ent_set_string | + | 3060 lu_ent_set_string |
- | 3088 lu_ent_get_first_value_strdup | + | 3078 lu_ent_get_first_value_strdup |
- | 3118 lu_error_free | + | 3108 lu_error_free |
- | 3132 lu_user_lock | + | 3122 lu_user_lock |
- | 3145 _fini | + | 3135 lu_strerror |
- | 3151 _init | + | 3147 lu_ent_free |
- | | + | 3159 lu_ent_new |
- | 3169 lu_ent_free | + | 3170 lu_user_modify |
- | 3181 lu_ent_new | + | |
- | 3192 lu_user_modify | + | |
- | 3207 lu_prompt_console | + | |
- | 3225 lu_start | + | |
- | 3234 lu_user_lookup_name | + | |
--More-- | --More-- | ||
</ | </ | ||
Ligne 2849: | Ligne 2866: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | | + | |
- | 2846 g_value_get_int64 | + | 2822 g_value_get_int64 |
- | 2864 is_selinux_enabled | + | 2840 is_selinux_enabled |
- | 2883 _ITM_deregisterTMCloneTable | + | 2859 _ITM_deregisterTMCloneTable |
- | 2918 g_value_array_get_nth | + | 2894 g_value_array_get_nth |
- | 2955 g_value_get_string | + | 2942 g_value_get_string |
- | 2974 g_type_check_value_holds | + | 2961 g_type_check_value_holds |
- | 2999 g_value_get_long | + | 2986 g_value_get_long |
- | 3016 _Jv_RegisterClasses | + | 3011 audit_log_acct_message |
- | 3044 _ITM_registerTMCloneTable | + | 3034 _ITM_registerTMCloneTable |
- | 3070 lu_ent_set_string | + | 3060 lu_ent_set_string |
- | 3088 lu_ent_get_first_value_strdup | + | 3078 lu_ent_get_first_value_strdup |
- | 3207 lu_prompt_console | + | 3185 lu_prompt_console |
- | 3234 lu_user_lookup_name | + | 3212 lu_user_lookup_name |
- | 3261 lu_ent_set_long | + | 3239 lu_ent_set_long |
- | 3303 lu_user_removepass | + | 3281 lu_user_removepass |
- | 3322 libgobject-2.0.so.0 | + | 3300 libgobject-2.0.so.0 |
- | 3342 libglib-2.0.so.0 | + | 3320 libglib-2.0.so.0 |
- | 3372 poptSetOtherOptionHelp | + | 3379 poptHelpOptions |
- | | + | 3435 poptSetOtherOptionHelp |
- | 3503 audit_log_acct_message | + | 3543 libpam_misc.so.0 |
- | 3599 libpam_misc.so.0 | + | 3584 audit_log_user_avc_message |
- | 3640 audit_log_user_avc_message | + | 3611 libselinux.so.1 |
- | 3667 audit_log_user_message | + | |
- | | + | |
- | 3706 selinux_set_callback | + | |
- | 3727 selinux_check_access | + | |
- | 3759 libpthread.so.0 | + | |
--More-- | --More-- | ||
</ | </ | ||
Ligne 2884: | Ligne 2896: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
/ | / | ||
- | / | + | / |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
/ | / | ||
/ | / | ||
- | / | ||
- | / | ||
- | / | ||
- | /bin/csh: @(#) Copyright (c) 1991 The Regents of the University of California. | ||
- | / | ||
- | /bin/drill: Copyright (c) 2004-2008 NLnet Labs. | ||
- | / | ||
- | / | ||
- | / | ||
/bin/gprof: @(#) Copyright (c) 1983 Regents of the University of California. | /bin/gprof: @(#) Copyright (c) 1983 Regents of the University of California. | ||
- | /bin/hpijs: Copyright (c) 2001-2004, Hewlett-Packard Co. | + | /bin/lsusb.py: # Copyright (c) 2009 Kurt Garloff |
- | / | + | / |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | /bin/orca: __copyright__ = " | + | |
- | / | + | |
/ | / | ||
/ | / | ||
- | /bin/ping: @(#) Copyright (c) 1989 The Regents of the University of California. | + | /bin/pinentry: # Copyright (c) 2014-2015 Red Hat |
- | /bin/ping6: @(#) Copyright (c) 1989 The Regents of the University of California. | + | /bin/pkgconf: Copyright |
+ | / | ||
/ | / | ||
- | /bin/qemu-img: qemu-img version 1.5.3, | + | /bin/pod2usage: # Copyright (c) 2001-2016 by Marek Rouchal. |
- | /bin/repoclosure: # seth vidal 2005 (c) etc etc | + | /bin/qemu-img: Copyright |
- | /bin/repodiff: # (c) 2007 Red Hat. Written by skvidal@fedoraproject.org | + | /bin/qemu-img: Copyright |
- | /bin/repo-graph: # (c) 2005 Panu Matilainen < | + | /bin/qemu-io: Copyright |
- | /bin/repomanage: # (c) Copyright Seth Vidal 2004 | + | /bin/qemu-nbd: Copyright |
- | /bin/repoquery: # (c) pmatilai@laiskiainen.org | + | /bin/qemu-pr-helper: Copyright |
- | /bin/repo-rss: # seth vidal 2005 (c) etc etc | + | /bin/rescan-scsi-bus.sh: # (c) 1998--2010 Kurt Garloff < |
- | /bin/repotrack: # (c) 2005 seth vidal skvidal at phy.duke.edu | + | /bin/rescan-scsi-bus.sh: # (c) 2006--2018 Hannes Reinecke, GNU GPL v2 or later |
/ | / | ||
- | /bin/saytime: ;; Copyright (c) 1996,1997 ;; | + | /bin/screen: Copyright (c) 2015-2017 Juergen Weigert, Alexander Naumov, Amadeusz Slawinski |
- | /bin/sbcdec: Copyright (c) 2004-2010 | + | /bin/screen: Copyright (c) 2010-2014 Juergen Weigert, Sadrul Habib Chowdhury |
- | / | + | / |
- | / | + | / |
- | / | + | |
- | / | + | |
/ | / | ||
- | /bin/sliceprint: # Copyright | + | /bin/scsi-rescan: # (c) 1998--2010 Kurt Garloff < |
- | /bin/soundstretch: Copyright | + | /bin/scsi-rescan: # (c) 2006--2018 Hannes Reinecke, GNU GPL v2 or later |
- | / | + | / |
- | /bin/tcptraceroute: # Copyright (c) | + | / |
- | /bin/tcsh: @(#) Copyright (c) 1991 The Regents of the University of California. | + | / |
- | /bin/text2wave: ;; | + | /bin/strace: Copyright (c) 1991-%s The strace developers <%s>. |
- | / | + | /bin/strace-log-merge: # Copyright (c) 2012-2019 |
- | / | + | /bin/systemd-analyze: hashmap_update(*uid_refs, UID_TO_PTR(uid), UINT32_TO_PTR(c)) >= 0 |
- | / | + | /bin/tree: $Version: $ tree v1.7.0 (c) 1996 - 2014 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro $ |
- | /bin/wavpack: | + | /bin/usb-devices: # Copyright (c) 2009 Greg Kroah-Hartman < |
- | / | + | /bin/usb-devices: # Copyright (c) 2009 Randy Dunlap < |
- | /bin/wvdialconf: Copyright (c) 1997-2005 Net Integration Technologies, | + | /bin/usb-devices: # Copyright (c) 2009 Frans Pop < |
- | /bin/wvgain: Copyright (c) 2005 - 2009 Conifer Software. | + | /bin/vdo: # Copyright |
- | /bin/wvunpack: Copyright (c) 1998 - 2009 Conifer Software. | + | /bin/vdo-by-dev: # Copyright |
- | /bin/yum-debug-dump: ## (c) 2008 Red Hat. Written by skvidal@fedoraproject.org | + | /bin/vdostats: # Copyright |
- | /bin/yum-debug-restore: ## (c) 2008 Red Hat. Written by skvidal@fedoraproject.org | + | |
- | /bin/zip: ight (c)H | + | |
/bin/zip: Copyright (c) 1990-2008 Info-ZIP. | /bin/zip: Copyright (c) 1990-2008 Info-ZIP. | ||
/bin/zip: Copyright (c) 1990-2008 Info-ZIP - Type '%s " | /bin/zip: Copyright (c) 1990-2008 Info-ZIP - Type '%s " | ||
+ | / | ||
/ | / | ||
/ | / | ||
Ligne 2964: | Ligne 2958: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **strings** command to view the command line switches. | **To do** : Use the **--help** option of the **strings** command to view the command line switches. | ||
</ | </ | ||
- | ===The comm Command=== | + | ===7.12 - The comm Command=== |
This command compares two text files and prints the differences to standard output: | This command compares two text files and prints the differences to standard output: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
root: | root: | ||
bin: | bin: | ||
Ligne 2986: | Ligne 2980: | ||
games: | games: | ||
ftp: | ftp: | ||
- | nobody:x:99:99:Nobody:/:/ | + | nobody:x:65534:65534:Kernel Overflow User:/:/ |
dbus: | dbus: | ||
- | polkitd:x:999:998:User for polkitd:/:/ | + | systemd-coredump:x:999:997:systemd Core Dumper:/:/ |
- | unbound:x:998:997:Unbound DNS resolver:/etc/unbound:/ | + | systemd-resolve:x:193:193:systemd Resolver:/:/ |
- | colord:x:997:996:User for colord:/var/lib/colord:/ | + | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ |
- | usbmuxd:x:113:113:usbmuxd user:/:/ | + | polkitd:x:998:996:User for polkitd:/:/ |
- | avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/ | + | unbound:x:997:994:Unbound |
- | avahi-autoipd: | + | libstoragemgmt:x:996:993:daemon account for libstoragemgmt:/ |
- | saslauth:x:996:76:" | + | cockpit-ws:x:995:991:User for cockpit-ws:/nonexisting:/ |
- | qemu: | + | sssd:x:994:990:User for sssd:/:/ |
- | libstoragemgmt: | + | setroubleshoot:x:993:989::/var/lib/setroubleshoot:/ |
- | rpc:x:32:32:Rpcbind Daemon:/ | + | |
- | rpcuser: | + | |
- | nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/ | + | |
- | rtkit:x: | + | |
- | radvd: | + | |
- | ntp: | + | |
- | chrony: | + | |
- | abrt: | + | |
- | pulse: | + | |
- | gdm: | + | |
- | gnome-initial-setup: | + | |
- | postfix: | + | |
sshd: | sshd: | ||
- | tcpdump: | + | chrony: |
+ | tcpdump: | ||
trainee10: | trainee10: | ||
- | trainee: | ||
- | tss: | ||
comm: file 2 is not in sorted order | comm: file 2 is not in sorted order | ||
+ | cockpit-wsinstance: | ||
+ | rngd: | ||
+ | gluster: | ||
+ | qemu: | ||
+ | rpc: | ||
+ | rpcuser: | ||
+ | saslauth: | ||
+ | radvd: | ||
+ | dnsmasq: | ||
Linux est super! | Linux est super! | ||
- | vboxadd:x:992:1::/var/run/vboxadd:/bin/false | + | trainee:x:1000:1000:trainee:/home/trainee:/bin/bash |
comm: file 1 is not in sorted order | comm: file 1 is not in sorted order | ||
- | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ | + | cockpit-wsinstance:x:991:987:User for cockpit-ws instances:/nonexisting:/ |
+ | rngd: | ||
+ | gluster: | ||
+ | qemu: | ||
+ | rpc: | ||
+ | rpcuser: | ||
+ | saslauth: | ||
+ | radvd: | ||
+ | dnsmasq: | ||
</ | </ | ||
Ligne 3028: | Ligne 3026: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
root: | root: | ||
bin: | bin: | ||
Ligne 3041: | Ligne 3039: | ||
games: | games: | ||
ftp: | ftp: | ||
- | nobody:x:99:99:Nobody:/:/ | + | nobody:x:65534:65534:Kernel Overflow User:/:/ |
dbus: | dbus: | ||
- | polkitd:x:999:998:User for polkitd:/:/ | + | systemd-coredump:x:999:997:systemd Core Dumper:/:/ |
- | unbound:x:998:997:Unbound DNS resolver:/etc/unbound:/ | + | systemd-resolve:x:193:193:systemd Resolver:/:/ |
- | colord:x:997:996:User for colord:/var/lib/colord:/ | + | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ |
- | usbmuxd:x:113:113:usbmuxd user:/:/ | + | polkitd:x:998:996:User for polkitd:/:/ |
- | avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/ | + | unbound:x:997:994:Unbound |
- | avahi-autoipd: | + | libstoragemgmt:x:996:993:daemon account for libstoragemgmt:/ |
- | saslauth:x:996:76:" | + | cockpit-ws:x:995:991:User for cockpit-ws:/nonexisting:/ |
- | qemu: | + | sssd:x:994:990:User for sssd:/:/ |
- | libstoragemgmt: | + | setroubleshoot:x:993:989::/var/lib/setroubleshoot:/ |
- | rpc:x:32:32:Rpcbind Daemon:/ | + | |
- | rpcuser: | + | |
- | nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/ | + | |
- | rtkit:x: | + | |
- | radvd: | + | |
- | ntp: | + | |
- | chrony: | + | |
- | abrt: | + | |
- | pulse: | + | |
- | gdm:x:42:42::/var/lib/gdm:/ | + | |
- | gnome-initial-setup: | + | |
- | postfix: | + | |
sshd: | sshd: | ||
- | tcpdump:x:72:72::/:/ | + | chrony:x:992:988::/var/ |
comm: file 2 is not in sorted order | comm: file 2 is not in sorted order | ||
comm: file 1 is not in sorted order | comm: file 1 is not in sorted order | ||
Ligne 3072: | Ligne 3058: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **comm** command to view the command line switches. | **To do** : Use the **--help** option of the **comm** command to view the command line switches. | ||
</ | </ | ||
- | ===The head Command=== | + | ===7.13 - The head Command=== |
The **head** command is used to display the first **x** lines of a file. The default value of x is 10: | The **head** command is used to display the first **x** lines of a file. The default value of x is 10: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
root: | root: | ||
bin: | bin: | ||
Ligne 3097: | Ligne 3083: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
root: | root: | ||
bin: | bin: | ||
Ligne 3110: | Ligne 3096: | ||
games: | games: | ||
ftp: | ftp: | ||
- | nobody:x:99:99:Nobody:/:/ | + | nobody:x:65534:65534:Kernel Overflow User:/:/ |
dbus: | dbus: | ||
- | polkitd:x:999:998:User for polkitd:/:/ | + | systemd-coredump:x:999:997:systemd Core Dumper:/:/ |
</ | </ | ||
Ligne 3118: | Ligne 3104: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
root: | root: | ||
bin: | bin: | ||
daemon: | daemon: | ||
adm: | adm: | ||
- | lp: | + | lp: |
</ | </ | ||
Ligne 3129: | Ligne 3115: | ||
< | < | ||
- | lp:x:4:7[root@centos7 | + | [root@centos8 |
root: | root: | ||
bin: | bin: | ||
Ligne 3142: | Ligne 3128: | ||
games: | games: | ||
ftp: | ftp: | ||
- | nobody:x:99:99:Nobody:/:/ | + | nobody:x:65534:65534:Kernel Overflow User:/:/ |
dbus: | dbus: | ||
- | polkitd: | + | systemd-coredump:x:999: |
- | unbound:x:998:997:Unbound DNS resolver:/ | + | systemd-resolve: |
- | colord:x:997:996:User for colord:/var/lib/colord:/ | + | tss: |
- | usbmuxd:x:113:113:usbmuxd user:/:/ | + | polkitd:x:998:996:User for polkitd:/:/ |
- | avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/ | + | unbound:x:997:994:Unbound DNS resolver:/ |
- | avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-autoipd:/ | + | libstoragemgmt:x:996:993:daemon account |
- | saslauth:x:996:76:" | + | cockpit-ws:x:995:991:User for cockpit-ws:/nonexisting:/ |
+ | sssd:x:994:990:User for sssd:/:/ | ||
+ | setroubleshoot: | ||
+ | sshd: | ||
+ | chrony:x:992:988::/var/lib/chrony:/ | ||
+ | tcpdump: | ||
+ | trainee: | ||
+ | cockpit-wsinstance: | ||
+ | rngd:x:990: | ||
+ | gluster: | ||
qemu: | qemu: | ||
- | libstoragemgmt: | ||
rpc: | rpc: | ||
rpcuser: | rpcuser: | ||
- | nfsnobody:x:65534:65534:Anonymous NFS User:/ | + | saslauth:x:988:76:Saslauthd us[root@centos8 |
- | rtkit: | + | |
- | radvd: | + | |
- | ntp: | + | |
- | chrony: | + | |
- | abrt: | + | |
- | pulse: | + | |
- | gdm: | + | |
- | gnome-initial-setup: | + | |
- | postfix: | + | |
- | sshd: | + | |
- | tcpdump: | + | |
- | trainee: | + | |
</ | </ | ||
Ligne 3173: | Ligne 3155: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
root: | root: | ||
bin: | bin: | ||
Ligne 3186: | Ligne 3168: | ||
games: | games: | ||
ftp: | ftp: | ||
- | nobody:x:99:99:Nobody:/:/ | + | nobody:x:65534:65534:Kernel Overflow |
- | [root@centos7 | + | |
+ | [root@centos8 | ||
root: | root: | ||
bin: | bin: | ||
Ligne 3200: | Ligne 3183: | ||
games: | games: | ||
ftp: | ftp: | ||
- | nobody:x:99:99:Nobody:/:/ | + | nobody:x:65534:65534:Kernel Overflow |
</ | </ | ||
Ligne 3216: | Ligne 3199: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **head** command to view the command line switches. | **To do** : Use the **--help** option of the **head** command to view the command line switches. | ||
</ | </ | ||
- | ===The tail Command=== | + | ===7.14 - The tail Command=== |
The **tail** command is used to display the last **x** lines of a file. The default value of x is 10: | The **tail** command is used to display the last **x** lines of a file. The default value of x is 10: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | abrt: | + | |
- | pulse: | + | |
- | gdm: | + | |
- | gnome-initial-setup: | + | |
- | postfix: | + | |
- | sshd: | + | |
- | tcpdump: | + | |
trainee: | trainee: | ||
- | vboxadd:x:992:1::/var/run/vboxadd:/bin/false | + | cockpit-wsinstance:x:991:987:User for cockpit-ws instances:/ |
- | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ | + | rngd: |
+ | gluster: | ||
+ | qemu:x:107:107:qemu user:/:/ | ||
+ | rpc: | ||
+ | rpcuser: | ||
+ | saslauth: | ||
+ | radvd: | ||
+ | dnsmasq: | ||
</ | </ | ||
Ligne 3241: | Ligne 3224: | ||
< | < | ||
- | [root@centos7 | + | root@centos8 |
- | nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/ | + | sssd:x:994:990:User for sssd:/:/ |
- | rtkit:x: | + | setroubleshoot:x:993:989::/var/lib/setroubleshoot:/ |
- | radvd: | + | |
- | ntp: | + | |
- | chrony: | + | |
- | abrt: | + | |
- | pulse: | + | |
- | gdm:x:42:42::/var/lib/gdm:/ | + | |
- | gnome-initial-setup: | + | |
- | postfix: | + | |
sshd: | sshd: | ||
+ | chrony: | ||
tcpdump: | tcpdump: | ||
trainee: | trainee: | ||
- | vboxadd:x:992:1::/var/run/vboxadd:/bin/false | + | cockpit-wsinstance:x:991:987:User for cockpit-ws instances:/ |
- | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ | + | rngd: |
+ | gluster: | ||
+ | qemu:x:107:107:qemu user:/:/ | ||
+ | rpc: | ||
+ | rpcuser: | ||
+ | saslauth: | ||
+ | radvd: | ||
+ | dnsmasq: | ||
</ | </ | ||
Ligne 3262: | Ligne 3245: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | bash | + | er:/ |
- | vboxadd:x:992:1::/var/ | + | radvd:x:75:75:radvd user:/:/sbin/nologin |
- | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ | + | dnsmasq:x:983:983:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/ |
</ | </ | ||
Ligne 3271: | Ligne 3254: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
7: | 7: | ||
sync: | sync: | ||
Ligne 3280: | Ligne 3263: | ||
games: | games: | ||
ftp: | ftp: | ||
- | nobody:x:99:99:Nobody:/:/ | + | nobody:x:65534:65534:Kernel Overflow User:/:/ |
dbus: | dbus: | ||
- | polkitd: | + | systemd-coredump:x:999: |
- | unbound:x:998:997:Unbound DNS resolver:/ | + | systemd-resolve: |
- | colord:x:997:996:User for colord:/var/lib/colord:/ | + | tss: |
- | usbmuxd:x:113:113:usbmuxd user:/:/ | + | polkitd:x:998:996:User for polkitd:/:/ |
- | avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/ | + | unbound:x:997:994:Unbound DNS resolver:/ |
- | avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-autoipd:/ | + | libstoragemgmt:x:996:993:daemon account |
- | saslauth:x:996:76:" | + | cockpit-ws:x:995:991:User for cockpit-ws:/nonexisting:/ |
+ | sssd:x:994:990:User for sssd:/:/ | ||
+ | setroubleshoot: | ||
+ | sshd: | ||
+ | chrony:x:992:988::/var/lib/chrony:/ | ||
+ | tcpdump: | ||
+ | trainee: | ||
+ | cockpit-wsinstance: | ||
+ | rngd:x:990: | ||
+ | gluster: | ||
qemu: | qemu: | ||
- | libstoragemgmt: | ||
rpc: | rpc: | ||
rpcuser: | rpcuser: | ||
- | nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/ | + | saslauth:x:988:76:Saslauthd user:/run/saslauthd:/ |
- | rtkit: | + | |
radvd: | radvd: | ||
- | ntp:x:38:38::/ | + | dnsmasq:x:983:983:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/ |
- | chrony: | + | |
- | abrt: | + | |
- | pulse: | + | |
- | gdm: | + | |
- | gnome-initial-setup: | + | |
- | postfix: | + | |
- | sshd: | + | |
- | tcpdump: | + | |
- | trainee: | + | |
- | vboxadd: | + | |
- | tss: | + | |
</ | </ | ||
Ligne 3313: | Ligne 3292: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | PulseAudio System Daemon:/var/ | + | nstances:/nonexisting:/ |
- | gdm:x:42:42::/var/lib/gdm:/ | + | rngd:x:990:986:Random Number Generator Daemon:/var/lib/rngd:/ |
- | gnome-initial-setup:x:993:991::/run/gnome-initial-setup/ | + | gluster:x:989:985:GlusterFS daemons:/run/gluster:/ |
- | postfix:x:89:89::/var/ | + | qemu:x:107:107:qemu user:/:/ |
- | sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/ | + | rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/ |
- | tcpdump:x:72:72::/:/ | + | rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/ |
- | trainee:x:1000:1000:trainee:/home/trainee:/bin/bash | + | saslauth:x:988:76:Saslauthd user:/run/saslauthd:/sbin/nologin |
- | vboxadd:x:992:1::/var/ | + | radvd:x:75:75:radvd user:/:/sbin/nologin |
- | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ | + | dnsmasq:x:983:983:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/ |
- | [root@centos7 | + | |
- | PulseAudio System Daemon:/var/ | + | [root@centos8 |
- | gdm:x:42:42::/var/lib/gdm:/ | + | nstances:/nonexisting:/ |
- | gnome-initial-setup:x:993:991::/run/gnome-initial-setup/ | + | rngd:x:990:986:Random Number Generator Daemon:/var/lib/rngd:/ |
- | postfix:x:89:89::/var/ | + | gluster:x:989:985:GlusterFS daemons:/run/gluster:/ |
- | sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/ | + | qemu:x:107:107:qemu user:/:/ |
- | tcpdump:x:72:72::/:/ | + | rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/ |
- | trainee:x:1000:1000:trainee:/home/trainee:/bin/bash | + | rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/ |
- | vboxadd:x:992:1::/var/ | + | saslauth:x:988:76:Saslauthd user:/run/saslauthd:/sbin/nologin |
- | tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ | + | radvd:x:75:75:radvd user:/:/sbin/nologin |
+ | dnsmasq:x:983:983:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/ | ||
</ | </ | ||
Ligne 3346: | Ligne 3326: | ||
| G | 1024*1024*1024 | | | G | 1024*1024*1024 | | ||
- | A useful switch to use with the tail command is **-f**. This switch continually updates the output: | + | A useful switch to use with the tail command is **-f**. This switch continually updates the output: |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Oct 19 15:58:06 centos7 dbus-daemon: | + | Apr 20 06:27:53 centos8 systemd[1]: Started dnf makecache. |
- | Oct 19 15:58:06 centos7 dbus[542]: [system] Activating service name=' | + | Apr 20 07:28:29 centos8 systemd[1]: Starting dnf makecache... |
- | Oct 19 15:58:06 centos7 dbus-daemon: | + | Apr 20 07:28:29 centos8 dnf[12423]: Metadata cache refreshed recently. |
- | Oct 19 15:58:06 centos7 dbus[542]: [system] Successfully activated | + | Apr 20 07:28:29 centos8 systemd[1]: dnf-makecache.service: Succeeded. |
- | Oct 19 16:00:01 centos7 | + | Apr 20 07:28:29 centos8 |
- | Oct 19 16:00:01 centos7 | + | Apr 20 07:50:35 centos8 |
- | Oct 19 16:00:01 centos7 | + | Apr 20 07:50:35 centos8 |
- | Oct 19 16:01:01 centos7 | + | Apr 20 07:50:36 centos8 |
- | Oct 19 16:01:01 centos7 | + | Apr 20 07:50:36 centos8 |
- | Oct 19 16:01:01 centos7 | + | Apr 20 07:50:36 centos8 |
^C | ^C | ||
</ | </ | ||
Ligne 3365: | Ligne 3345: | ||
==Command Line Switches== | ==Command Line Switches== | ||
- | <WRAP center round important | + | <WRAP center round todo 60%> |
**To do** : Use the **--help** option of the **head** command to view the command line switches. | **To do** : Use the **--help** option of the **head** command to view the command line switches. | ||
</ | </ | ||
- | ===LAB #4 - Use the grep, tr and cut to extract your IP address from the output of ifconfig=== | + | ====LAB #8 - Use the grep, tr and cut to extract your IPv4 address from the output of ifconfig==== |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | enp0s3: flags=4163< | + | ens18: flags=4163< |
- | inet 10.0.2.15 | + | inet 10.0.2.45 |
- | inet6 fe80::a00:27ff:febd:f523 | + | inet6 fe80::86b6:8d39:cab2:d84d |
- | ether 08:00:27:bd:f5:23 | + | ether 4e:b1:31:bd:5d:b2 |
- | RX packets | + | RX packets |
RX errors 0 dropped 0 overruns 0 frame 0 | RX errors 0 dropped 0 overruns 0 frame 0 | ||
- | TX packets | + | TX packets |
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
- | [root@centos7 | + | [root@centos8 |
- | inet 10.0.2.15 | + | inet 10.0.2.45 |
- | inet6 fe80::a00:27ff:febd:f523 | + | inet6 fe80::86b6:8d39:cab2:d84d |
- | [root@centos7 | + | [root@centos8 |
- | inet 10.0.2.15 | + | inet 10.0.2.45 |
- | [root@centos7 | + | [root@centos8 |
- | : | + | : |
- | [root@centos7 | + | [root@centos8 |
- | 10.0.2.15 | + | 10.0.2.45 |
</ | </ | ||
Ligne 3400: | Ligne 3380: | ||
</ | </ | ||
- | ----- | + | ====LAB #9 - Use the grep, awk and sed to extract your IPv4 address from the output of ip==== |
- | < | + | |
- | <div align=" | + | |
- | Copyright © 2004-2019 Hugh Norris.< | + | |
- | </ | + | |
- | </ | + | |
- | ----- | + | |
+ | < | ||
+ | [root@centos8 tmp]# ip addr show ens18 | ||
+ | 2: ens18: < | ||
+ | link/ether 4e: | ||
+ | inet 10.0.2.45/ | ||
+ | | ||
+ | inet6 fe80:: | ||
+ | | ||
+ | |||
+ | [root@centos8 tmp]# ip addr show ens18 | grep " | ||
+ | inet 10.0.2.45/ | ||
+ | inet6 fe80:: | ||
+ | |||
+ | [root@centos8 tmp]# ip addr show ens18 | grep " | ||
+ | inet 10.0.2.45/ | ||
+ | |||
+ | [root@centos8 tmp]# ip addr show ens18 | grep " | ||
+ | 10.0.2.45/ | ||
+ | |||
+ | [root@centos8 tmp]# ip addr show ens18 | grep " | ||
+ | 10.0.2.45 | ||
+ | </ | ||
+ | |||
+ | ----- | ||
+ | Copyright © 2023 Hugh Norris. |