Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
elearning:workbooks:redhat:rh124en:l103 [2024/11/11 10:48] – created adminelearning:workbooks:redhat:rh124en:l103 [2024/11/26 10:29] (Version actuelle) admin
Ligne 1: Ligne 1:
-~~PDF:LANDSCAPE~~ 
- 
 Version : **2024.01** Version : **2024.01**
  
-Dernière mise-à-jour : ~~LASTMOD~~+Last updated : ~~LASTMOD~~
  
-======RH12404 - Commandes de Base et de Manipulation de Fichiers Texte======+======RH12404 - Basic Shell Commands and Text Manipulation Tools======
  
-=====Contenu du Module=====+=====Contents=====
  
-  * **RH12404 - Commandes de Base et de Manipulation de Fichiers Texte** +  * **RH12404 - Basic Shell Commands and Text Manipulation Tools** 
-    * Contenu du Module +    * Contents 
-    * LAB #1 - 38 Commandes de Base +    * LAB #1 - Use of Basic Shell Commands 
-      * 1.1 - La commande stty +      * 1.1 - The stty Command 
-      * 1.2 - La commande date +      * 1.2 - The date command 
-      * 1.3 - La commande who +      * 1.3 - The who Command 
-      * 1.4 - La commande df +      * 1.4 - The df Command 
-      * 1.5 - La commande free +      * 1.5 - The free Command 
-      * 1.6 - La commande whoami +      * 1.6 - The whoami Command 
-      * 1.7 - La commande pwd +      * 1.7 - The pwd Command 
-      * 1.8 - La commande cd +      * 1.8 - The cd Command 
-      * 1.9 - La commande ls +      * 1.9 - The ls Command 
-      * 1.10 - La commande lsof +      * 1.10 - The lsof Command 
-      * 1.11 - La commande touch +      * 1.11 - The touch Command 
-      * 1.12 - La commande echo +      * 1.12 - The echo Command 
-      * 1.13 - La commande cp +      * 1.13 - The cp Command 
-      * 1.14 - La commande file +      * 1.14 - The file Command 
-      * 1.15 - La commande cat +      * 1.15 - The cat Command 
-      * 1.16 - La commande mv +      * 1.16 - The mv Command 
-      * 1.17 - La commande mkdir +      * 1.17 - The mkdir Command 
-      * 1.18 - La commande rmdir +      * 1.18 - The rmdir Command 
-      * 1.19 - La commande rm +      * 1.19 - The rm Command 
-      * 1.20 - La commande sort +      * 1.20 - The sort Command 
-      * 1.21 - La commande more +      * 1.21 - The more Command 
-      * 1.22 - La commande less +      * 1.22 - The less Command 
-      * 1.23 - La commande find +      * 1.23 - The find Command 
-      * 1.24 - La commande su +      * 1.24 - The su Command 
-      * 1.25 - Les commandes locate et updatedb +      * 1.25 - The updatedb and locate Commands 
-      * 1.26 - La commande whereis +      * 1.26 - The whereis Command 
-      * 1.27 - La commande which +      * 1.27 - The which Command 
-      * 1.28 - La commande uptime +      * 1.28 - The uptime Command 
-      * 1.29 - La commande +      * 1.29 - The Command 
-      * 1.30 - La commande uname +      * 1.30 - The uname Command 
-      * 1.31 - La commande du +      * 1.31 - The du Command 
-      * 1.32 - La commande clear +      * 1.32 - The clear Command 
-      * 1.33 - La commande exit +      * 1.33 - The exit Command 
-      * 1.34 - La commande logout +      * 1.34 - The logout Command 
-      * 1.35 - La commande sleep +      * 1.35 - The sleep Command 
-      * 1.36 - La Commande wall+      * 1.36 - The wall Command
       * 1.37 - The seq Command       * 1.37 - The seq Command
-      * 1.38 - La Commande screen +      * 1.38 - The screen Command 
-    * LAB #2 - Options et Arguments +    * LAB #2 - Switches and Arguments 
-    * LAB #3 - Expressions Régulières +    * LAB #3 - Regular Expressions 
-      ERb +        BREs 
-      ERe +        EREs 
-    * Outils de Manipulation de Fichiers Texte +    * Manipulating Text Files 
-      * Présentation des Commandes grep, egrep et fgrep +      * Text-search Utilities 
-        * La commande grep +        * The grep Command 
-        * La Commande egrep +        * The egrep Command 
-        * La Commande fgrep +        * The fgrep Command 
-        * LAB #4 - Utiliser grep, egrep et fgrep +        * LAB #4 - Using grep, egrep and fgrep 
-      * Présentation de la Commande sed +      * The Stream EDitor SED 
-        * LAB #5 - Utiliser la Commande sed +        * LAB #5 - Using sed 
-      * Présentation de La Commande awk +      * The Text Processor AWK 
-        * Découpage en champs +        * Presentation 
-        * Critères +        * Field Separation 
-          * Une expression régulière valide pour la ligne +        * Conditions 
-          * Une expression régulière valide pour un champ +          * A regular expression applied to a record 
-          * Une comparaison +          * A regular expression applied to a field 
-          * Un opérateur logique +          * Comparisons 
-          * Une variable interne +          * Logical Operators  
-        * Scripts awk +          * Built-in Variables 
-        * La Fonction printf +        * Awk Scripts 
-        * Structures de Contrôle+        * The printf function 
 +        * Control Statements
           * if           * if
           * for           * for
           * while           * while
           * do-while           * do-while
-        * LAB #Utiliser la Commande awk +        * LAB #Using awk 
-      * LAB #7 -Autres Commandes Utiles +    * LAB 7 - Other Useful Commands 
-        * 7.1 - La Commande expand +      * 7.1 - The expand Command 
-        * 7.2 - La Commande unexpand +      * 7.2 - La Commande unexpand 
-        * 7.3 - La Commande cut +      * 7.3 - The cut command 
-        * 7.4 - La Commande uniq +      * 7.4 - The uniq Command 
-        * 7.5 - La Commande tr +      * 7.5 - The tr Command 
-        * 7.6 - La Commande paste +      * 7.6 - The paste Command 
-        * 7.7 - La Commande split +      * 7.7 - The split Command 
-        * 7.8 - La Commande diff +      * 7.8 - The diff Command 
-        * 7.9 - La Commande cmp +      * 7.9 - The cmp Command 
-        * 7.10 - La commande patch +      * 7.10 - The patch Command 
-        * 7.11 - La commande strings +      * 7.11 - The strings Command 
-        * 7.12 - La commande comm +      * 7.12 - The comm Command 
-        * 7.13 - La commande head +      * 7.13 - The head Command 
-        * 7.14 - La commande tail +      * 7.14 - The tail Command 
-    * LAB #8 - Utiliser les commandes ifconfig, grep, tr et cut pour isoler l'adresse IPv4 +    * LAB #8 - Use the grep, tr and cut commands to extract your IPv4 address from the output of ifconfig 
-    * LAB #9 - Utiliser les commandes ip, grep, awk et sed pour isoler l'adresse IPv4+    * LAB #9 - Use the grep, awk and sed commands to extract your IPv4 address from the output of ip
  
-=====LAB #1 - 38 Commandes de Base=====+=====LAB #1 - Use of Basic Shell Commands=====
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** - Vous êtes actuellement connecté(e) en tant que root dans votre terminal. Avant de procéder plus lointapez la commande exit et appuyez sur la touch <key>Entrée</key>.+**To do** - You are currently the root user in your terminal. Before proceeding furthertype **exit** and hit the <key>Enter</key> key.
 </WRAP> </WRAP>
  
-====1.1 - La commande stty=====+====1.1 - The stty Command====
  
-Dès votre connexion à un système Linux, Il est conseillé de lancer la commande **stty** :+Using this command with the **-a** switch allows you to identify which combination of keys should be used to control a foreground process:
  
 <code> <code>
Ligne 121: Ligne 120:
 </code> </code>
  
-Dans l’information qui s’affiche à l’écran, cherchez la chaîne intr =. Si la valeur est «Del», il faut utiliser la touche **Suppr** au lieu de la commande **^C** pour interrompre un programme en cours d’exécution dans un terminal.+<WRAP center round important 60%> 
 +**Important** - The two most important combinations are **intr = ^C** and **susp = ^Z**. The former kills the process whilst the latter suspends its execution. 
 +</WRAP>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **stty** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **stty** command to view the command line switches (also known as a **parameters**, **options** or **flags**).
 </WRAP> </WRAP>
  
-====1.2 - La commande date====+====1.2 - The date command====
  
-Cette commande affiche la date et l’heure de la machineLa commande peut aussi être utilisée pour régler la date du système :+This command's output gives the current system date and timeThe command can also be used to set the system date:
  
 <code> <code>
Ligne 138: Ligne 139:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **date** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **date** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.3 - La commande who====+====1.3 - The who Command====
  
-Cette commande affiche les utilisateurs connectés au système:+This command's output shows who is currently connected to the system:
  
 <code> <code>
Ligne 153: Ligne 154:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **who** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **who** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.4 - La commande df====+====1.4 - The df Command====
  
-Cette commande affiche l'espace disque libre sur chacun des unités montés (connectés au système):+This command's output shows the free space on each mounted block device:
  
 <code> <code>
Ligne 175: Ligne 176:
 </code> </code>
  
-Les unités sont en blocs. Afin d'//humaniser// la sortie, il est possible d'utiliser l'option **-h**. Une option est aussi connue sous le nom **parameter**, **switch** ou **flag** : +The units are shown as **blocks**. In order to **humanize** the outputit is possible to use the **-h** switch:
  
 <code> <code>
Ligne 189: Ligne 190:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **df** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **df** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.5 - La commande free====+====1.5 - The free Command====
  
-Cette commande affiche les détails de la mémoire disponible :+This command's output shows the memory usage:
  
 <code> <code>
Ligne 206: Ligne 207:
 </code> </code>
  
-Les unités sont en blocsAfin d'//humaniser// la sortieil est possible d'utiliser l'option **-h**.+The units are shown as **blocks**In order to **humanize** the outputit is possible to use the **-h** switch:
  
 <code> <code>
Ligne 215: Ligne 216:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **free** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **free** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.6 - La commande whoami====+====1.6 - The whoami Command====
  
-Cette commande affiche le nom associé à l'UID courant effectif, autrement dit, le nom de votre compte courant :+This command's output indicates the user name associated with the current effective user ID:
  
 <code> <code>
Ligne 230: Ligne 231:
 </code> </code>
  
-Devenez maintenant l'administrateur **root** :+Now become the system administrator **root**:
  
 <code> <code>
 [trainee@redhat9 ~]$ su - [trainee@redhat9 ~]$ su -
-Password: +Password: fenestros
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que le mot de passe saisi ne sera PAS visible.+**Important** : Note that the password will not be visible.
 </WRAP> </WRAP>
  
-Saisissez maintenant la commande **whoami** de nouveau :+Now use the **whoami** command again:
  
 <code> <code>
Ligne 249: Ligne 250:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez maintenant que vous êtes root.+**Important** : Note the current effective user ID is root.
 </WRAP> </WRAP>
  
-Saisissiez en suite la commande **exit** pour redevenir l'utilisateur **trainee** :+Finally execute the **exit** command to return as **trainee**:
  
 <code> <code>
Ligne 260: Ligne 261:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **whoami** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **whoami** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.7 - La commande pwd====+====1.7 - The pwd Command====
  
-Cette commande affiche le répertoire courant de travail :+This command's output shows the current working directory:
  
 <code> <code>
Ligne 275: Ligne 276:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez la commande **help** avec l'option **pwd** pour visualiser les options de la commande.+**To do** : Use the **help** command with **pwd** option to view the command line switches.
 </WRAP> </WRAP>
  
-====1.8 - La commande cd====+====1.8 - The cd Command===
  
-Cette commande permet de changer de répertoire courant pour le répertoire passé en argument à la commande :+This command's output changes the current working directory to that specified by the **argument**:
  
 <code> <code>
 [trainee@redhat9 ~]$ cd /tmp [trainee@redhat9 ~]$ cd /tmp
 +
 [trainee@redhat9 tmp]$ pwd [trainee@redhat9 tmp]$ pwd
 /tmp /tmp
 +
 [trainee@redhat9 tmp]$  [trainee@redhat9 tmp]$ 
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez la commande **help** avec l'option **cd** pour visualiser les options de la commande.+**To do** : Use the **help** command with **cd** option to view the command line switches.
 </WRAP> </WRAP>
  
-====1.9 - La commande ls====+====1.9 - The ls Command===
  
-Cette commande permet de lister le contenu d'un répertoire passé en argument à la commandeSi aucun argument n'est spécifiéla commande liste le contenu du répertoire courant :+This commands output lists information about the files in directory specified as an argument. If no argument is specifiedthe output lists the files in the current working directory
  
 <code> <code>
Ligne 318: Ligne 321:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **ls** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **ls** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.10 - La commande lsof====+====1.10 - The lsof Command====
  
-La commande **lsof** affiche des informations sur les fichiers ouverts par des processus :+This command's output shows information about open files:
  
 <code> <code>
 [trainee@redhat9 tmp]$ su - [trainee@redhat9 tmp]$ su -
 Password: fenestros Password: fenestros
 +
 [root@redhat9 ~]# lsof | more [root@redhat9 ~]# lsof | more
 COMMAND    PID  TID TASKCMD             USER   FD      TYPE             DEVICE  SIZE/OFF       NODE NAME COMMAND    PID  TID TASKCMD             USER   FD      TYPE             DEVICE  SIZE/OFF       NODE NAME
Ligne 362: Ligne 366:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **lsof** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **lsof** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.11 - La commande touch====+====1.11 - The touch Command====
  
-Cette commande sert à modifier l'horodatage de la date de dernière modification du contenu (**mtime**) et la date du dernier accès (**atime**), d'un ou de plusieurs fichiers passé(s) en argument(s), selon la date couranteSi le(s) fichier(s) n'existe(nt) pasil(s) est (sont) créé(s) :+This command updates the access and modification times of one or several file(s) to the current timeIf the file does not existthe system creates an empty file:
  
 <code> <code>
 +[root@redhat9 ~]# exit
 +logout
 +
 [trainee@redhat9 tmp]$ touch test [trainee@redhat9 tmp]$ touch test
 +
 [trainee@redhat9 tmp]$ ls [trainee@redhat9 tmp]$ ls
 dbus-G7skg3Wlpv dbus-G7skg3Wlpv
Ligne 390: Ligne 398:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **touch** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **touch** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.12 - La commande echo====+====1.12 - The echo Command ====
  
-Cette commande écrit les arguments vers la sortie standard (autrement dit à l'écran) :+This command writes the arguments to the standard output (i.e. the screen):
  
 <code> <code>
Ligne 405: Ligne 413:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez la commande **help** avec l'option **echo** pour visualiser les options de la commande.+**To do** : Use the **help** command with **echo** option to view the command line switches.
 </WRAP> </WRAP>
  
-====1.13 - La commande cp====+====1.13 - The cp Command===
  
-La commande cp permet de copier une source vers une destination ou de multiples sources vers un répertoire :+This command is used to copy a file to a destination or multiple files to a directory:
  
 <code> <code>
 [trainee@redhat9 tmp]$ cp test ~ [trainee@redhat9 tmp]$ cp test ~
 +
 [trainee@redhat9 tmp]$ ls -l ~ [trainee@redhat9 tmp]$ ls -l ~
 total 4 total 4
Ligne 432: Ligne 441:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation du caractère ~ (tilde) qui est un caractère spécial indiquant le répertoire personnel de l'utilisateur courant, dans ce cas /home/trainee.+Note the use of the **~** (tilde) character which is a shortcut to the current user's home directory. In the case of this example : **/home/trainee**.
 </WRAP> </WRAP>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **cp** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **cp** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.14 - La commande file====+====1.14 - The file Command====
  
-Cette commande permet de connaître le type d'un fichier:+This command determines a file type:
  
 <code> <code>
Ligne 451: Ligne 460:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que la commande vous indique le type de fichier en fonction de son contenu. Dans l'exemple précédentpuisque le fichier est vide, la commande file ne peut pas indiqué le type de fichier.+**Important** - Note that in the case of the first line of the above outputthe command **file** is incapable of informing you of the type of file since **test** is empty.
 </WRAP> </WRAP>
  
-Redirigez, en utilisant le caractère **>**la sortie de la commande **echo** vers le fichier **/home/trainee/test** de façon à ce que ce dernier contient le texte **fenestros** :+Using the <key>></key> keyredirect the output of **echo fenestros** into the **/home/trainee/test** file as follows:
  
 <code> <code>
Ligne 460: Ligne 469:
 </code> </code>
  
-En utilisant de nouveau la commande **file**, celle-ci est capable de vous indiquer le type de fichier :+Now use the **file** command once again to determine the file type:
  
 <code> <code>
Ligne 467: Ligne 476:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **file** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **file** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.15 - La commande cat====+====1.15 - The cat Command====
  
-La commande **cat** permet de concaténer les fichiers passés en argumentou de l'entrée standard ( le **clavier** )vers la sortie standard ( l'**écran** )Dans le cas où il n'y a qu'un seul fichier passé en argument, le contenu de celui-ci est affiché à l'écran :+This commands concatenate filesor standard inputto standard outputIn the case of only one file as an argument, the effective result is to print the file contents to the screen:
  
 <code> <code>
Ligne 482: Ligne 491:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **cat** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **cat** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.16 - La commande mv====+====1.16 - The mv Command====
  
-La commande **mv** permet déplacer ou de renommer un fichier ou répertoire. +This command renames a source to a destination or moves sources to a directory:
- +
-Utilisez la commande **mv** pour déplacer le fichier **test** de votre répertoire personnel vers le répertoire courant :+
  
 <code> <code>
 [trainee@redhat9 tmp]$ mv ~/test . [trainee@redhat9 tmp]$ mv ~/test .
 +
 [trainee@redhat9 tmp]$ ls -l ~ [trainee@redhat9 tmp]$ ls -l ~
 total 4 total 4
Ligne 507: Ligne 515:
 drwxr-xr-x. 2 trainee trainee   6 Oct 19  2023 Videos drwxr-xr-x. 2 trainee trainee   6 Oct 19  2023 Videos
 -rw-r--r--. 1 trainee trainee 442 Sep 25 14:24 vitext -rw-r--r--. 1 trainee trainee 442 Sep 25 14:24 vitext
 +
 [trainee@redhat9 tmp]$ mv test TeSt [trainee@redhat9 tmp]$ mv test TeSt
 +
 [trainee@redhat9 tmp]$ ls -l [trainee@redhat9 tmp]$ ls -l
 total 4 total 4
Ligne 526: Ligne 536:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation du raccourci pour indiquer le répertoire courant.+**Important** - Note the use of the shortcut **.** which indicates the current working directory.
 </WRAP> </WRAP>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **mv** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **mv** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.17 - La commande mkdir====+====1.17 - The mkdir Command====
  
-La commande **mkdir** permet de créer un répertoire.+This command creates the directory(ies) if it (they) does (do) not exist:
  
 <code> <code>
 [trainee@redhat9 tmp]$ cd ~ [trainee@redhat9 tmp]$ cd ~
 +
 [trainee@redhat9 ~]$ mkdir testdir [trainee@redhat9 ~]$ mkdir testdir
 +
 [trainee@redhat9 ~]$ ls [trainee@redhat9 ~]$ ls
 Desktop  Documents  Downloads  Music  Pictures  Public  Templates  testdir  Videos  vitext Desktop  Documents  Downloads  Music  Pictures  Public  Templates  testdir  Videos  vitext
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **mkdir** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **mkdir** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.18 - La commande rmdir====+====1.18 - The rmdir Command====
  
-La commande **rmdir** permet de supprimer un répertoire **vide** :+This command removes the directory(ies) if it (they) is (are) **empty**:
  
 <code> <code>
 [trainee@redhat9 ~]$ rmdir testdir [trainee@redhat9 ~]$ rmdir testdir
 +
 [trainee@redhat9 ~]$ ls [trainee@redhat9 ~]$ ls
 Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos  vitext Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos  vitext
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **rmdir** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **rmdir** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.19 - La commande rm====+====1.19 - The rm Command====
  
-La commande rm permet de supprimer un répertoire **vide ou non** ou un fichier :+This command removes a directory, empty or not, as well as files:
  
 <code> <code>
 [trainee@redhat9 ~]$ mkdir testdir1 [trainee@redhat9 ~]$ mkdir testdir1
 +
 [trainee@redhat9 ~]$ cd /tmp [trainee@redhat9 ~]$ cd /tmp
 +
 [trainee@redhat9 tmp]$ echo "fenestros" > TeSt [trainee@redhat9 tmp]$ echo "fenestros" > TeSt
 +
 [trainee@redhat9 tmp]$ cd ~ [trainee@redhat9 tmp]$ cd ~
 +
 [trainee@redhat9 ~]$ mv /tmp/TeSt ~/testdir1 [trainee@redhat9 ~]$ mv /tmp/TeSt ~/testdir1
 +
 [trainee@redhat9 ~]$ ls -lR testdir1/ [trainee@redhat9 ~]$ ls -lR testdir1/
 testdir1/: testdir1/:
 total 4 total 4
 -rw-r--r--. 1 trainee trainee 10 Sep 25 15:08 TeSt -rw-r--r--. 1 trainee trainee 10 Sep 25 15:08 TeSt
 +
 [trainee@redhat9 ~]$ rmdir testdir1/ [trainee@redhat9 ~]$ rmdir testdir1/
 rmdir: failed to remove 'testdir1/': Directory not empty rmdir: failed to remove 'testdir1/': Directory not empty
 +
 [trainee@redhat9 ~]$ rm -rf testdir1 [trainee@redhat9 ~]$ rm -rf testdir1
 +
 [trainee@redhat9 ~]$ ls [trainee@redhat9 ~]$ ls
 Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos  vitext Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos  vitext
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **rm** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **rm** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.20 - La commande sort====+====1.20 - The sort Command ====
  
-Cette commande trie dans le canal d’entrée et retourne à l’écran une liste triée.+This command writes a sorted concatenation of all files to standard output:
  
 <code> <code>
 [trainee@redhat9 ~]$ touch aac abc bca xyz [trainee@redhat9 ~]$ touch aac abc bca xyz
 +
 [trainee@redhat9 ~]$ ls [trainee@redhat9 ~]$ ls
 +
 aac  abc  bca  Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos  vitext  xyz aac  abc  bca  Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos  vitext  xyz
 +
 [trainee@redhat9 ~]$ ls | sort [trainee@redhat9 ~]$ ls | sort
 aac aac
Ligne 617: Ligne 641:
 vitext vitext
 xyz xyz
 +
 [trainee@redhat9 ~]$ ls | sort -r [trainee@redhat9 ~]$ ls | sort -r
 xyz xyz
Ligne 634: Ligne 659:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation du caractère spécial |, appelé un pipe. Un pipe est utilisé pour présenter sur l'entrée standard de la commande qui suit, la sortie standard de la commande qui précède.+**Important** - Note the use of the **|** charactercalled a **pipe**pipe is used to channel the standard output of the command that precedes it into the standard input of the command that follows it.
 </WRAP> </WRAP>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **sort** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **sort** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.21 - La commande more====+====1.21 - The more Command ====
  
-Cette commande affiche le contenu d’un fichier texte et l’envoi page par page au canal de sortie à l'aide de la touche <key>espace</key> :+This command is used to display a long file page by page:
  
 <code> <code>
Ligne 680: Ligne 705:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : L'utilisation de la touche <key>Entrée</key> permet de défiler le fichier ligne par ligne. L'utilisation de la touche <key>Barre d'espace</key> permet de défiler le fichier écran par écran. L'utilisation de la touche <key>Q</key> permets de revenir au prompt.+**Important** - The <key>Enter</key> key scrolls down line by line, the <key>Space Bar</key> key scrolls down page by page and the <key>Q</key> key comes back to the command line prompt.
 </WRAP> </WRAP>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **more** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **more** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.22 - La commande less====+====1.22 - The less Command====
  
-La commande **less** produit un résultat similaire à la commande **more**. Utilisez la commande **less** en vous référant à l'aide de la commande avec **less - -help**. Laquelle des deux commandes vous semble la plus puissante ?+The **less** command produces a similar result to that of the **more** commandPractice using the less command and refer to the help using **less --help**. Which command seems the most powerful and versatile ?
  
 <code> <code>
Ligne 725: Ligne 750:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **less** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **less** command to view the command line switches.
 </WRAP> </WRAP>
 + 
 +====1.23 - The find Command===
  
-====1.23 La commande find==== +This command is used to search for a specific file or directoryThe default path is the **current directory** and default expression is **-print**
- +
-Cette commande sert à rechercher un ou des fichiers dans le répertoire courant ou le répertoire spécifié en argument :+
  
 <code> <code>
 [trainee@redhat9 ~]$ find acc [trainee@redhat9 ~]$ find acc
 find: ‘acc’: No such file or directory find: ‘acc’: No such file or directory
 +
 [trainee@redhat9 ~]$ find aac [trainee@redhat9 ~]$ find aac
 aac aac
Ligne 743: Ligne 769:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que si le fichier n'existe pas le système vous en informe clairementNotez aussi que ce fichier existe le système vous en informe en vous indiquant son nom.+**Important** : Note that when the file cannot be found, the find command informs you clearlyHowever when the file is found, the find command just prints the name of the file to standard output.
 </WRAP> </WRAP>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **find** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **find** command to view the command line switches.
 </WRAP> </WRAP>
 + 
 +====1.24 - The su Command===
  
-====1.24 - La commande su==== +This command is used to change the effective user id and group id to that of the user passed as an argumentWhen executed with no argument, the system assumes the destination user is **root**:
- +
-La commande su permet d'assumer l'identité d'un autre utilisateur du système à condition de connaître son mot de passeExécutée sans argument, le système suppose que vous souhaitez devenir **root** :+
  
 <code> <code>
 [trainee@redhat9 ~]$ su - [trainee@redhat9 ~]$ su -
 Password: fenestros Password: fenestros
 +
 [root@redhat9 ~]#   [root@redhat9 ~]#  
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que le mot de passe saisi ne sera PAS visible.+**Important** : Note that the password will not be visible.
 </WRAP> </WRAP>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **su** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **su** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.25 - Les commandes locate et updatedb====+====1.25 - The updatedb and locate Commands====
  
-La commande **locate** sert à rechercher un ou des fichiers dans l'ensemble du système de fichiers en commençant à la racine (/) en spécifiant une chaîne à rechercher en argumant à la commandeLa commande locate utilise une base de données afin d'effectuer sa recherchePour construire ou mettre à jour cette base de données avant l'utilisation de la commande pour une recherche, il faut utiliser la commande **updatedb** en tant que root.+The **locate** command is used to list files in databases that match a pattern supplied as an argument to the commandThe **locate** command uses a databaseThis database needs to be created using the **updatedb** command before using the **locate** command
  
-La commande **updatedb** peut être configurée en éditant son fichier de configuration **/etc/updatedb.conf** :+The default database is **/var/lib/mlocate/mlocate.db**: 
 + 
 +<code> 
 +[root@redhat9 ~]# ls -l /var/lib/mlocate/mlocate.db 
 +-rw-r-----. 1 root slocate 3436535 Sep 25 15:21 /var/lib/mlocate/mlocate.db 
 +</code> 
 + 
 + 
 +<WRAP center round important 60%> 
 +**Important** : For information concerning the database format, please see **man 5 locatedb**. 
 +</WRAP> 
 + 
 +The **updatedb** command is configured by editing the **/etc/updatedb.conf** file:
  
 <code> <code>
Ligne 786: Ligne 825:
 </code> </code>
  
-L'utilisation des deux commandes est illustrée ci-après :+Use of these two commands is very simple:
  
 <code> <code>
 [root@redhat9 ~]# updatedb [root@redhat9 ~]# updatedb
 +
 [root@redhat9 ~]# locate aac [root@redhat9 ~]# locate aac
 /home/trainee/aac /home/trainee/aac
Ligne 845: Ligne 885:
 </code> </code>
  
-La base de données par défaut est **/var/lib/mlocate/mlocate.db** :+The default database is **/var/lib/mlocate/mlocate.db** :
  
 <code> <code>
Ligne 853: Ligne 893:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Pour plus d'information concernant le format de la base de donnéesconsultez **man 5 locatedb**.+**Important**: For more information about the database format, see **man 5 locatedb**.
 </WRAP> </WRAP>
  
-===Options des commandes===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** des commandes **updatedb** et **locate** pour visualiser les options des commandes.+**To do** : Use the **--help** option of the **updatedb** and **locate** commands to view their command line switches.
 </WRAP> </WRAP>
  
-====1.26 - La commande whereis====+==== 1.26 - The whereis Command===
  
-La commande **whereis** permet une recherche de l'emplacement des exécutablesdes fichiers de configuration et des manuels pour la commande passée en argument :+This command is used to show the full paths of the executablethe configuration files and the manuals associated with the argument: 
  
 <code> <code>
Ligne 871: Ligne 911:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **whereis** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **whereis** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.27 - La commande which====+==== 1.27 - The which Command====
  
-La commande **which** permet une recherche de l'emplacement d'un exécutable dans le PATH de l'utilisateur courant et retourne le premier qui est trouvé :+This command searches the PATH variable and returns to standard output the first full path associated with the argument:
  
 <code> <code>
Ligne 886: Ligne 926:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **which** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **which** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.28 - La commande uptime====+====1.28 - The uptime Command====
  
-Cette commande nous indique l'heure actuellela durée depuis laquelle le système fonctionnele nombre d'utilisateurs actuellement connectés et la charge système moyenne pour les dernières minute, 5 minutes et 15 minutes :+This command prints to standard output the current timethe length of time the system has been upthe number of users on the system and the average number of jobs in the run queue over the last 1, 5 and 15 minutes:
  
 <code> <code>
Ligne 901: Ligne 941:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches=== 
 + 
 +The switches associated with this command are:
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **uptime** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **uptime** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.29 - La commande w====+====1.29 - The Command====
  
-Cette commande reprend les informations de la commande **uptime** et y ajoute des détails sur les utilisateurs connectés via un terminal :+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**:
  
 <code> <code>
Ligne 918: Ligne 960:
 </code> </code>
  
-La valeur JCPU indique le temps processeur utilisé par tous les processus attachés au terminal de la connexionCette valeur n'inclut pas les temps des anciens processus en arrière plan.+The JCPU time is the time used by all processes attached to the ttyIt does not include past background jobs, but does include currently running background jobs.
  
-La valeur PCPU indique le temps processeur utilisé par les processus attachés au terminal de la connexion et actuellement en cours (autrement dit le processus identifié dans la colonne **WHAT**)+The PCPU time is the time used by the current process, named in the **what** field
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **w** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **w** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.30 - La commande uname====+====1.30 - The uname Command====
  
-Cette commande affiche des informations sur le système :+This command prints system information to the standard output:
  
 <code> <code>
 [root@redhat9 ~]# uname -a [root@redhat9 ~]# uname -a
 Linux redhat9.ittraining.loc 5.14.0-427.37.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Sep 13 12:41:50 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux Linux redhat9.ittraining.loc 5.14.0-427.37.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Sep 13 12:41:50 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux
 +
 [root@redhat9 ~]# uname -s [root@redhat9 ~]# uname -s
 Linux Linux
 +
 [root@redhat9 ~]# uname -n [root@redhat9 ~]# uname -n
 redhat9.ittraining.loc redhat9.ittraining.loc
 +
 [root@redhat9 ~]# uname -r [root@redhat9 ~]# uname -r
 5.14.0-427.37.1.el9_4.x86_64 5.14.0-427.37.1.el9_4.x86_64
 +
 [root@redhat9 ~]# uname -v [root@redhat9 ~]# uname -v
 #1 SMP PREEMPT_DYNAMIC Fri Sep 13 12:41:50 EDT 2024 #1 SMP PREEMPT_DYNAMIC Fri Sep 13 12:41:50 EDT 2024
 +
 [root@redhat9 ~]# uname -m [root@redhat9 ~]# uname -m
 x86_64 x86_64
 +
 [root@redhat9 ~]# uname -p [root@redhat9 ~]# uname -p
 x86_64 x86_64
 +
 [root@redhat9 ~]# uname -i [root@redhat9 ~]# uname -i
 x86_64 x86_64
 +
 [root@redhat9 ~]# uname -o [root@redhat9 ~]# uname -o
 GNU/Linux GNU/Linux
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **uname** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **uname** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.31 - La commande du====+====1.31 - The du Command====
  
-La commande du peut être utilisée pour afficher la taille des fichiers contenus dans les répertoires passés en arguments. L'utilisation suivante de la commande avec les options -s et -h sur la racine du système affiche la somme des sous-répertoires avec un affichage //humanisé// en KoMo et Go :+This command summarizes disk usage of each filerecursively for directories:
  
 <code> <code>
Ligne 988: Ligne 1038:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation de la redirection **2>/dev/null**. Cette chaîne envoie les erreurs éventuelles, contenues dans le canal appelé le canal des erreurs, à **/dev/null** de façon à ce que les erreurs n'apparaissent pas à l'écranLe canal des erreurs sera couvert dans le cours **La Ligne de Commande**.+**Important** : Note the use of the **2>/dev/null** redirectionThis sends all eventual errors in the **file descriptor** directly to **/dev/null** so that they do not appear in the outputFile descriptors are covered in the **The Command Line Interface** unit.
 </WRAP> </WRAP>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **du** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **du** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.32 - La commande clear====+==== 1.32 - The clear Command ====
  
-Cette commande est utilisée pour effacer le contenu de l'écran courant du terminal :+This command is used to clear the current screen of the terminal:
  
 <code> <code>
Ligne 1007: Ligne 1057:
 </code> </code>
  
-====1.33 - La commande exit====+==== 1.33 - The exit Command ====
  
-Cette commande ferme le terminal courant :+This command exits the current shell:
  
 <code> <code>
Ligne 1017: Ligne 1067:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez la commande **help** avec l'option **exit** pour visualiser les options de la commande.+**To do** : Use the **help** command with **exit** option to view the command line switches.
 </WRAP> </WRAP>
  
-====1.34 - La commande logout====+====1.34 - The logout Command====
  
-Cette commande est utilisée pour se déconnecter d'un terminal de connexion en écrivant les données umtp et wmtp dans les fichiers de journalisation.+This command logs out a user from a login shell writing the utmp and wtmp entries in the log files.
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez la commande **help** avec l'option **logout** pour visualiser les options de la commande.+**To do** : Use the **help** command with **logout** option to view the command line switches.
 </WRAP> </WRAP>
  
-====1.35 - La commande sleep====+====1.35 - The sleep Command ====
  
-Cette commande pause le terminal pour le nombre de secondes passé en argument :+This command pauses for a number seconds. The number is specified as the first argument.
  
 <code> <code>
Ligne 1042: Ligne 1092:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **sleep** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **sleep** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.36 - La Commande wall====+====1.36 - The wall Command====
  
-La commande **wall**  envoie  un  message  à  tous  les  utilisateurs  connectés dont l’autorisation mesg(1) est positionnée à yes. Le message peut être fourni en tant qu’argument sur la ligne de commandeou il peut être envoyé sur l’entrée standard de wall. +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 wallor it can be sent to wall's standard input When using the standard input from a terminal, the message should be terminated with the EOF key (usually Control-D). The length of the message is limited to 20 lines. For every invocation of wall a notification will be written to syslog, with facility LOG_USER and level LOG_INFO:
  
 <code> <code>
 [trainee@redhat9 ~]$ su - [trainee@redhat9 ~]$ su -
 Password: fenestros Password: fenestros
 +
 [root@redhat9 ~]# wall this is a message from root [root@redhat9 ~]# wall this is a message from root
                                                                                                                                                                
Ligne 1062: Ligne 1113:
 </code> </code>
  
-Notez que la commande wall ignore la variable d’environnement TZ. L’heure affichée est basée sur les paramètres de régionalisation du système :+The wall command ignores the TZ environment variableThe time displayed on the first page is based on the system's regionalisation parameters:
  
 <code> <code>
Ligne 1069: Ligne 1120:
 </code> </code>
  
-====1.37 - La Commande seq====+====1.37 - The seq Command====
  
-La commande **seq** affiche une séquence de nombres du PREMIER au DERNIER par pas d'un INCREMENT. La commande prend la forme suivante :+The **seq** command prints numbers from FIRST to LAST, in steps of INCREMENT:
  
-  * **seq** [optionsDERNIER +  * seq [OPTION]... LAST 
-  * **seq** [optionsPREMIER DERNIER +  * seq [OPTION]... FIRST LAST 
-  * **seq** [optionsPREMIER INCREMENT DERNIER+  * seq [OPTION]... FIRST INCREMENT LAST
  
-Par exemple :+For example :
  
 <code> <code>
Ligne 1091: Ligne 1142:
 9 9
 10 10
 +
 [root@redhat9 ~]# seq 10 20 [root@redhat9 ~]# seq 10 20
 10 10
Ligne 1103: Ligne 1155:
 19 19
 20 20
 +
 [root@redhat9 ~]# seq 20 10 90 [root@redhat9 ~]# seq 20 10 90
 20 20
Ligne 1114: Ligne 1167:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **seq** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **seq** command to view the command line switches.
 </WRAP> </WRAP>
  
-====1.38 - La Commande screen====+====1.38 - The screen Command====
  
-La commande **screen** est un « multiplexeur de terminaux » permettant d'ouvrir jusqu'à 10 numérotés de 0 à 9 terminaux dans une même consolede passer de l'un à l'autre et de les récupérer plus tard.+Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive  shells). Each virtual terminal provides the functions of a DEC VT100 terminal andin addition, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022 standards (e.g. insert/delete line and support for multiple character sets). There is a  scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows moving text regions between windows.
  
-La commande **screen** n'est pas installée par défaut sous RHEL/CentOS 8. Installez donc le paquet du même nom que la commande à partir du dépôt EPEL :+The screen command is not installed by default under RHEL 9:
  
 <code> <code>
Ligne 1224: Ligne 1277:
 </code> </code>
  
-Créez maintenant une session avec screen :+Create a session with screen:
  
 <code> <code>
Ligne 1230: Ligne 1283:
 </code> </code>
  
-Appuyez maintenant sur <key>CTRL</key> <key>a</key> puis relachez la touche <key>a</key> et appuyez sur la touche <key>c</key> pour créer un deuxième screen imbriqué dans la même session.+Now press the <key>CTRL</key> and <key>a</key> keys, release the <key>a</key> key and press the <key>c</key> key in order to create a second **nested** screen.
  
-Pour repasser au premier screen, appuyez sur <key>CTRL</key> <key>a</key> <key>a</key>Ceci permet de basculer entre les deux derniers screens.+To return to the first screen, use the <key>CTRL</key> <key>a</key> <key>a</key> keysThis allows you to toggle between the last two screens used.
  
-Pour voir les screens actifsutilisez la commande suivante :+To see the status of all active screens, use the **screen -ls** command:
  
 <code> <code>
Ligne 1243: Ligne 1296:
 </code> </code>
  
-Dans votre screen, saisissez les commandes suivantes :+Now enter the following commands:
  
 <code> <code>
 [root@redhat9 ~]# sleep 999 & [root@redhat9 ~]# sleep 999 &
 [1] 3153 [1] 3153
 +
 [root@redhat9 ~]# jobs -l [root@redhat9 ~]# jobs -l
 [1]+  3153 Running                 sleep 999 & [1]+  3153 Running                 sleep 999 &
 +
 [root@redhat9 ~]# [root@redhat9 ~]#
 </code> </code>
  
-Pour détacher le screen, appuyez sur <key>CTRL</key> <key>a</key> puis relachez la touche <key>a</key> et appuyez sur la touche <key>d</key> :+In order to detach the current screen press the <key>CTRL</key> and <key>a</key> keys, release the <key>a</key> key and press the <key>d</key> key:
  
 <code> <code>
 [root@redhat9 ~]# screen -S mysession [root@redhat9 ~]# screen -S mysession
 [detached from 3103.mysession] [detached from 3103.mysession]
 +
 [root@redhat9 ~]# [root@redhat9 ~]#
 </code> </code>
  
-Pour rattacher le screen, saisissez la commande suivante :+To re-attach the screen, execute the following command:
  
 <code> <code>
Ligne 1267: Ligne 1323:
 </code> </code>
  
-<WRAP center round important 60%> +Using the jobs command, check if the process created by the sleep command is still running:
-**Important** - Vous verrez en tant que titre de votre terminal la chaîne **[screen 0: root@redhat9:~]**. +
-</WRAP> +
- +
-Utilisez la commande jobs pour vérifier si le processus créé par la commande sleep est toujours en cours de fonctionnement :+
  
 <code> <code>
-[root@redhat9 ~]# screen -ls 
-There is a screen on: 
-        3103.mysession  (Attached) 
-1 Socket in /run/screen/S-root. 
-[root@redhat9 ~]# sleep 999 & 
-[1] 3153 
-[root@redhat9 ~]# jobs -l 
-[1]+  3153 Running                 sleep 999 & 
 [root@redhat9 ~]# jobs -l [root@redhat9 ~]# jobs -l
 [1]+  3153 Running                 sleep 999 & [1]+  3153 Running                 sleep 999 &
 +
 [root@redhat9 ~]# [root@redhat9 ~]#
 </code> </code>
  
-<WRAP center round important 60%> +To move forward or backwards between screens press the <key>CTRL</key> and <key>a</key> keys, release the <key>a</key> key and press the <key>n</key> key or press the <key>CTRL</key> and <key>a</key> keys, release the <key>a</key> key and press the <key>p</key> key.
-Pour naviguer entre les screens il convient d'appuyer sur <key>CTRL</key> <key>a</key> puis relachez la touche <key>a</key> et appuyez sur la touche <key>n</key> ou d'appuyer sur <key>CTRL</key> <key>a</key> puis relachez la touche <key>a</key> et appuyez sur la touche <key>p</key>. +
-</WRAP>+
  
-Détachez de nouveau le screen actuel en appuyant sur <key>CTRL</key> <key>a</key> puis en relachant la touche <key>a</key> et en appuyant sur la touche <key>d</key> :+Once again detach the current screen by pressing the <key>CTRL</key> <key>a</key> keys, releasing the <key>a</key> key and then pressing <key>d</key>:
  
 <code> <code>
 [root@redhat9 ~]# screen -S mysession [root@redhat9 ~]# screen -S mysession
 [detached from 3103.mysession] [detached from 3103.mysession]
-[root@redhat9 ~]# screen -r + 
-[detached from 3103.mysession] +[root@redhat9 ~]#
-[root@redhat9 ~]# +
 </code> </code>
  
-Créez maintenant un autre screencette fois-ci, non imbriqué :+Now create a newnon-nested screen:
  
 <code> <code>
Ligne 1307: Ligne 1349:
 </code> </code>
  
-Constatez le résultat :+Use the **screen -ls** command to see what has happened:
  
 <code> <code>
Ligne 1317: Ligne 1359:
 </code> </code>
  
-Notez cependant que ce screen 0 n'est pas le même que le screen 0 précédent dans lequel vous avez exécuté la commande sleep :+Note, however, that this screen 0 is not the same as the previous screen 0 in which you executed the sleep command:
  
 <code> <code>
Ligne 1324: Ligne 1366:
 </code> </code>
  
-Ratachez maintenant le screen **mysession** :+To re-attach a specific screen, reference it by it's number:
  
 <code> <code>
Ligne 1336: Ligne 1378:
 </code> </code>
  
-Détachez-vous du screen en appuyant sur <key>CTRL</key> <key>a</key> puis relachez la touche <key>a</key> et appuyez sur la touche <key>d</key> :+Once again detach the current screen by pressing the <key>CTRL</key> <key>a</key> keys, releasing the <key>a</key> key and then pressing <key>d</key>:
  
 <code> <code>
-[root@redhat9 ~]# screen -S mysession 
-[detached from 3103.mysession] 
-[root@redhat9 ~]# screen -r 
-[detached from 3103.mysession] 
 [root@redhat9 ~]# screen -S mysession1 [root@redhat9 ~]# screen -S mysession1
 [detached from 3181.mysession1] [detached from 3181.mysession1]
 +
 [root@redhat9 ~]#  [root@redhat9 ~]# 
 </code> </code>
  
-Constatez de nouveau le résultat :+Now check which screen you are connected to: 
 + 
 +<code> 
 +[root@redhat9 ~]# screen -ls 
 +There are screens on: 
 +        3181.mysession1 (Detached) 
 +        3103.mysession  (Attached) 
 +2 Sockets in /run/screen/S-root. 
 +</code> 
 + 
 +Finally, kill the two sessions:
  
 <code> <code>
Ligne 1362: Ligne 1411:
 <code> <code>
 [root@redhat9 ~]# screen -XS 3181 quit [root@redhat9 ~]# screen -XS 3181 quit
 +
 [root@redhat9 ~]# screen -ls [root@redhat9 ~]# screen -ls
 There is a screen on: There is a screen on:
         3103.mysession  (Detached)         3103.mysession  (Detached)
 1 Socket in /run/screen/S-root. 1 Socket in /run/screen/S-root.
 +
 [root@redhat9 ~]# screen -XS 3103 quit [root@redhat9 ~]# screen -XS 3103 quit
 +
 [root@redhat9 ~]# screen -ls [root@redhat9 ~]# screen -ls
 No Sockets found in /run/screen/S-root. No Sockets found in /run/screen/S-root.
Ligne 1372: Ligne 1424:
 </code> </code>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **screen** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **screen** command to view the command line switches.
 </WRAP> </WRAP>
  
-=====LAB #2 - Options et Arguments=====+=====LAB #2 - Switches and Arguments=====
  
-Les options sous Linux peuvent être exprimées au format court ou au format long. Plusieurs différences sont importantes à noter.+Switches under Linux can either be short or long. Several differences are important to note
  
-Premièrement les options courtes sont précédées par un simple tiré **-**, tandis que les options longues sont précédées par deux tirés **--**.+Firstly short options are generally preceded by a single dash **-**, whilst long options are preceded by a double dash **- -**.
  
-Un exemple est l'option de l'aide pour la plupart des commandes bash :+An example is the help option used with most commands:
  
   * -h   * -h
   * --help   * --help
  
-Deuxièmement les options courtes peuvent être combinées tandis que les options longues ne peuvent pas l'êtrePar exemple, la ligne de commande **ls -l -a -i** peut être aussi écrite **ls -lai**, **ls -lia** ou encore **ls -ali** :+Secondly, Linux short switches can be combined whereas long switches cannot be combinedFor example **ls -l -a -i** can also be written as **ls -lai**, **ls -lia** or **ls -ali**:
  
 <code> <code>
Ligne 1462: Ligne 1514:
 </code> </code>
  
-La commande **ls -l --all --inode** ne peut pas être écrite **ls -l --allinode** :+However **ls -l --all --inode** cannot be written **ls -l --allinode**:
  
 <code> <code>
Ligne 1494: Ligne 1546:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Les options prenant un argument ne sont pas combinées avec les autres options.+**Important** - You should **not** combine any short options that take an argument.
 </WRAP> </WRAP>
  
-=====LAB #3 - Expressions Régulières=====+=====LAB #3 - Regular Expressions=====
  
-La manipulation de fichiers textes utilise des **expressions régulières**. Sous Linux il existe deux types d'expressions régulières :+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:
  
-  * expressions régulières basiques - IEEE POSIX Basic Regular Expressions, appelées **ERb**+  * The IEEE POSIX Basic Regular Expressions (**BRE**) understood by the commands **vi**, **grep**, **expr** and **sed**, 
-    * utilisées par les commandes **vi**, **grep**, **expr** et **sed**, +  * The IEEE POSIX Extended Regular Expressions (**ERE**) understood by the commands **egrep** ( grep -E ) and **awk**.
-  * expressions régulières étendues - IEEE POSIX Extended Regular Expressions, appelées **ERe**+
-    * utilisées par les commandes **egrep** ( grep -E ) et **awk**.+
  
-Les expressions régulières utilisent des caractères spéciauxCertains caractères sont communs aux Erb et aux Ere :+Regular Expressions use **Metacharacters**Certain are common to both BREs and EREs:
  
-^Caractère spécial ^ Description ^ +^Metacharacter ^ Description ^ 
-| %%^%% | Trouver la chaîne au début de la ligne +**%%^%%**//string// Match lines beginning with //string// 
-| $ | Trouver la chaîne à la fin de la ligne +//string//**$** Match lines ending with //string// 
-| \ | Annuler l'effet spécial du caractère suivant +**\**//Metacharacter// Cancel any special effect associated with //Metacharacter// 
-| [ ] | Trouver n'importe quel des caractères entre les crochets +**[**//string//**]** Match any of the characters within //string// 
-| [%%^%%] | Exclure les caractères entre crochets +**[%%^%%**//string//**]**Exclude any of the characters in //string// 
-| . | Trouver n'importe quel caractère sauf à la fin de la ligne +**.** Match any character except when at the end of a line 
-| * | Trouver ou plus du caractère qui précède +//character//***** | Match or more occurrences of //character// 
-| \< | Trouver la chaîne au début d'un mot +| \< | Match //string// at the beginning of a word 
-| \> | Trouver la chaîne à la fin d'un mot |+| \> | Match //string// at the end of a word |
  
-====ERb====+===BREs===
  
-Certains caractères spéciaux sont spécifiques aux ERb :+Certain Metacharacters are specific to BREs:
  
-^Caractère spécial ^ Description ^ +^Metacharacter ^ Description ^ 
-| \{x,y\} | Trouver de **x** à **y** occurrences de ce qui précède +**\{x,y\}** Match from **x** to **y** occurrences of the preceeding element 
-| \{x\} | Trouver exactement le nombre **x** d'occurrences de ce qui précède +**\{x\}** Match exactly **x** occurrences of the preceeding element 
-| \{x,\} | Trouver le nombre **x** ou plus d'occurrences de ce qui précède +**\{x,\}** Match **x** or more occurrences of the preceeding element 
-| \(ERb) | Mémoriser une ERb +| \(BRE) | Commit to memory the BRE 
-| \1 | Rappeler la première ERb mémorisée +| \1 | Recall the first BRE committed to memory 
-| \2, \3 ... | Rappeler la deuxième ERb mémoriséerappeler la troisième ERb mémorisée etc |+| \2, \3 ... | Recall the second BRE committed to memoryrecall the third BRE committed to memory ... |
  
-====ERe====+===EREs===
  
-Certains caractères spéciaux sont spécifiques aux ERe :+Certain Metacharacters are specific to EREs:
  
-^Caractère spécial ^ Description ^ +^Metacharacter ^ Description ^ 
-| ? | Trouver 0 ou 1 occurrence de ce qui précède | +| {x,y} | Match from **x** to **y** occurrences of the preceeding element 
-| + | Trouver 1 ou **n** d'occurrences de ce qui précède | +| {x} | Match exactly **x** occurrences of the preceeding element 
-| {x,y} | Trouver de **x** à **y** occurrences de ce qui précède +| {x,} | Match **x** or more occurrences of the preceeding element  
-| {x} | Trouver exactement le nombre **x** d'occurrences de ce qui précède +| ? | Matches 0 or 1 occurrence of the preceeding element 
-| {x,} | Trouver le nombre **x** ou plus d'occurrences de ce qui précède ++ | Matches 1 or more occurrence(sof the preceeding element 
-| () | Faire un **ET** des expressions régulières entre les paranthèses +| %%|%% | Matches either the expression before or the expression after the operator | 
-| %%|%% | Faire un **OU** des expressions régulières se trouvant de chaque côté du pipe |+| () | Combines the Reguler Expressions between the parentheses |
  
-=====Outils de Manipulation de Fichiers Texte=====+=====Manipulating Text Files=====
  
-====Présentation des Commandes grep, egrep et fgrep====+====Text-search Utilities====
  
-===La commande grep===+===The grep Command===
  
-La commande grep peut être utilisée pour rechercher des lignes contenant une chaîne de caractères dans un jeu de fichiers+The **grep** command can be used to find lines containing a string of characters in a group of files. The **-v** or **--invert-case** option can be stipulated to find lines that do **not** contain the specified string.
  
-Par défaut, la commande grep est sensible à la cassePour rendre cette commande insensible à la casse, il faut utiliser l'option **-i**. +The grep command is case sensitiveThe **-i** or **--ignore-case** option can be specified in order to use grep in a non case sensitive search.
  
-La commande grep peut être aussi utilisée pour faire l'inverse, autrement dit de montrer les lignes qui ne contiennent pas la chaîne recherchée. Dans ce cas, il faut utiliser l'option **–v**.+The grep command can also use **BREs**.
  
-La commande grep peut être utilisée avec des **Expressions Régulières basiques**. Ceci est utile pour rechercher dans le contenu de fichiers. +==Command Line Switches==
- +
-==Options de la commande==+
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **grep** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **grep** command to view the command line switches.
 </WRAP> </WRAP>
  
-===La Commande egrep===+===The egrep Command===
  
-La commande **egrep** est identique à la commande **grep -E**. Dans les deux cas, l'utilisation des expressions régulières est étendue aux ERe.+The **egrep** command is identical to the **grep** command when used with the **-E** switchBoth can use EREs.
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **egrep** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **egrep** command to view the command line switches.
 </WRAP> </WRAP>
  
-===La Commande fgrep===+===The fgrep Command===
  
-La commande **fgrep** est identique à la commande **grep -F**. Dans les deux cas et par défaut la recherche concerne une chaîne de caractères interprétés dans un sens littéral sans utilisation de caractères spéciaux ni d'expressions régulières. +The **fgrep** command is identical to the **grep** command when used with the **-F** switchBoth have no knowledge of Regular Expressions.
- +
-==Options de la commande==+
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **fgrep** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **fgrep** command to view the command line switches.
 </WRAP> </WRAP>
  
-===LAB #4 - Utiliser grep, egrep et fgrep===+===LAB #4 - Using grep, egrep and fgrep===
  
-Creéz le fichier **/tmp/greptest** :+Create the following file:
  
 <code> <code>
 [root@redhat9 ~]# cd /tmp [root@redhat9 ~]# cd /tmp
 +
 [root@redhat9 tmp]# vi greptest [root@redhat9 tmp]# vi greptest
 +
 [root@redhat9 tmp]# cat greptest [root@redhat9 tmp]# cat greptest
 fenestrOS fenestrOS
Ligne 1601: Ligne 1649:
 </code> </code>
  
-Recherchez maintenant toute ligne du fichier **/tmp/greptest** contenant au moins une lettre :+ 
 +Now use grep to search for lines containing at least one uppercase or lowercase letter:
  
 <code> <code>
Ligne 1612: Ligne 1661:
 </code> </code>
  
-Recherchez maintenant toute ligne contenant au moins une lettre ou un chiffre :+Next use grep to search for lines containing at least one uppercase or lowercase letter or a number:
  
 <code> <code>
Ligne 1624: Ligne 1673:
 </code> </code>
  
-<WRAP center round important 60%> +To search for the NNN-NNNN pattern where N is a number, use the following command:
-**Important** : Notez la présence de la ligne 555-5555. +
-</WRAP> +
- +
-Recherchez maintenant toute ligne contenant un numéro de téléphone au format NNN-NNNN :+
  
 <code> <code>
Ligne 1635: Ligne 1680:
 </code> </code>
  
-Recherchez maintenant toute ligne contenant exactement un caractère :+Lines containing just one character have that character both at the beginning (**^**) and at the end (**$**) of the line
  
 <code> <code>
Ligne 1643: Ligne 1688:
 </code> </code>
  
-<WRAP center round important 60%> +To search for a line containing a special character such as **.**, that character needs to be preceded by **\**:
-**Important** : Notez l'utilisation des caractères spéciaux le début de ligne : ^n'importe quel caractère : . et la fin de ligne : $. +
-</WRAP> +
- +
-Recherchez maintenant toute ligne commençant par un point :+
  
 <code> <code>
Ligne 1656: Ligne 1697:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation du caractère d'échappement \ pour annuler l'effet du caractère spécial **.** +**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 'directory' -e "pattern"**. You can also search only within certain files by specifying the files extensions: **grep --include={*.doc,*.xls} -rnw 'directory' -e "pattern"**. Finally you can exclude certain file extensions as follows: **grep --exclude=*.doc -rnw 'directory' -e "pattern"**.
-</WRAP> +
- +
-<WRAP center round important 60%> +
-**Important** : La commande grep peut aussi être utilisée pour rechercher une chaîne dans tous les fichiers d'un répertoire spécifié : **grep -rnw 'directory' -e "pattern"**. Vous pouvez aussi spécifier les extentions des fichiers dans lesquels vous voulez rechercher la chaîne : **grep --include={*.doc,*.xls} -rnw 'directory' -e "pattern"**. Dernièrement vous pouvez exclure des fichiers de la recherche de la façon suivante : **grep --exclude=*.doc -rnw 'directory' -e "pattern"**.+
 </WRAP> </WRAP>
  
-Modifiez le fichier **/tmp/greptest** selon l'exemple ci-dessous :+Make the following changes to the greptest file:
  
 <code> <code>
Ligne 1683: Ligne 1720:
 </code> </code>
  
-Utilisez maintenant la commande **grep** avec l'option **-E** pour supprimer les lignes de commentaires ainsi que les lignes vides :+Now use the **grep** command with the **-E** switch to remove all the comments and empty lines:
  
 <code> <code>
Ligne 1697: Ligne 1734:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation des parenthèses pour faire un regroupement ainsi que le pipe pour représenter un OU. L'expression '^(#|$)' indique donc "toute ligne commençant par le caractère #" OU "toute ligne où le début de la ligne est aussi la fin de la ligne".+**Important** - The expression **'^(#|$)'** matches all lines beginning with the **#** character OR all lines with zero characters between the start and the end of the line.
 </WRAP> </WRAP>
  
-Utilisez maintenant la commande **egrep** pour envoyer le contenu du fichier **/tmp/greptest**, sans commentaires et sans lignes videsdans le fichier **/tmp/greptest1** :+Now use the **egrep** command to do the same thingthis time redirecting the output to the file **/tmp/greptest1**:
  
 <code> <code>
Ligne 1715: Ligne 1752:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Cette commande est particulièrement utile face à un fichier de configuration de plusieurs centaines de lignes dont certaines contiennent des directives activées d'autres sont vides ou en commentaires. De cette façon vous pouvez généré facilement un fichier ne contenant que les directives activées.+**Important**: The above command is very useful when you want to quickly ascertain which directives are active in a very long configuration file.
 </WRAP> </WRAP>
  
-Modifiez le fichier **/tmp/greptest** selon l'exemple ci-dessous :+Make the following changes to the greptest file:
  
 <code> <code>
 [root@redhat9 tmp]# vi greptest [root@redhat9 tmp]# vi greptest
 +
 [root@redhat9 tmp]# cat greptest [root@redhat9 tmp]# cat greptest
 # Starting comment # Starting comment
Ligne 1739: Ligne 1777:
 </code> </code>
  
-Utilisez maintenant la commande **fgrep** pour rechercher la ligne commençant par le caractère **^** :+Now use fgrep to match the line starting with the **^** character:
  
 <code> <code>
Ligne 1746: Ligne 1784:
 </code> </code>
  
-Comparez le résultat ci-dessus avec celui de la commande grep :+Compare the above output to that when using the grep command:
  
 <code> <code>
Ligne 1766: Ligne 1804:
 </code> </code>
  
-La ligne de commande en utilisant la commande grep devrait être :+As you can see, grep matched **every** line that had a //beginning//. In order to get the same result as the grep command, you need to use the following command:
  
 <code> <code>
Ligne 1773: Ligne 1811:
 </code> </code>
  
-====Présentation de la Commande sed====+====The Stream EDitor SED====
  
-La commande **sed** ou //Stream EDitor// est un éditeur de texte non-intéractifLes actions spécifiées par la commande sed sont exécutées par défaut sur chaque ligne du fichier. La commande sed ne modifie pas le fichier d'origine et sa sortie standard est le canal 1. +**sed** is an abbreviation of //Stream EDitor// and is a non-interactive text editor. sed's basic syntax is as follows:
- +
-Si plusieurs actions sont spécifiées dans la ligne de commande, chacune doit être précédée par l'option **-e**. +
- +
-La syntaxe de la commande sed est la suivante :+
  
 <file> <file>
-sed [adressecommande [arguments]+sed [addresscommand [arguments] file
 </file> </file>
  
-L'**adresse** permet de stipuler les lignes concernées par la **commande**.+The specified commands are applied to each line in the file unless an //address// is specified. Sed prints all results to standard output and does not modify the source file. The address therefore specifies which lines are concerned by the command.
  
-La syntaxe d'une adresse peut être :+sed's addresses are as follows:
  
-^adresse Lignes concernées +^address Matching lines 
-La ligne numéro **a** | +Line number **x** | 
-| $ | La dernière ligne +| $ | The last line of the file 
-| /ERb/ | Les lignes qui correspondent à l'ERb +| /BRE/ | Lines matching the specified BRE 
-a,De la ligne numéro **a** jusqu'à la ligne numéro **b** | +x,From line **x** to line **y** | 
-| /ERb1/, /ERb2/ | Toutes les lignes entre la première occurrence correspondant à l'ERb1 jusqu'à la première occurrence correspondant à l'ERb2 |+| /ERb1/, /ERb2/ | All lines from the first line that matches the first BRE to the first line that matches the second BRE |
  
-Le commandes de sed sont :+sed's commands are as follows:
  
-^commande ^ Description ^ +^command ^ Description ^ 
-| d | Ne pas afficher la ou les ligne(s) | +| d | Do not show the matching line(s) on standard output 
-| p | Afficher la ou les ligne(s) | +| p | Show the matching line(s) on standard output  
-| s | Effectuer une substitution | +| s | Do a substitution upon match 
-| w | Ecrire le ou les ligne(s) dans un fichier +| w | Write the matching line(s) to a file 
-| = | Afficher le numéro de la ligne spécifiée +| = | Print the matching line's number 
-| ! | Exécuter la commande ci-dessus sur toutes les lignes sauf celle spécifiées dans l'adresse |+| ! | Exclude the line(s) matching the address |
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **sed** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **fgrep** command to view the command line switches.
 </WRAP> </WRAP>
  
-===LAB #5 - Utiliser la Commande sed===+===LAB #5 - Using sed===
  
-La commande **d** de sed permet de ne pas afficher certaines lignes à l'écran. Dans l'exemple qui suit, les 10 premières lignes du fichier **/etc/services** ne sont pas affichées à l'écran :+Start by displaying the contents of the file **/etc/services** whilst inhibiting the display of the first 10 lines:
  
 <code> <code>
Ligne 1841: Ligne 1875:
 systat          11/udp          users systat          11/udp          users
 daytime         13/tcp daytime         13/tcp
---Plus--                    +--More--                    
 </code> </code>
  
-Dans l'exemple qui suit, sed n'affiche pas de lignes de commentaires, c'est-à-dire les lignes commençant par le caractère **#** :+Now display the same file without any commented lines:
  
 <code> <code>
Ligne 1871: Ligne 1905:
 ftp             21/tcp ftp             21/tcp
 ftp             21/udp          fsp fspd ftp             21/udp          fsp fspd
---Plus--                        +--More--                        
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que l'ERb est entourée des caractères / et /.+**Important**: Note that the BRE is preceeded and followed by the **/** character.
 </WRAP> </WRAP>
  
-La commande sed vous permet d'afficher à l'écran certaines lignes spécifiées en utilisant la commande **p** :+Continue by trying to just display the first two lines of **/etc/passwd**:
  
 <code> <code>
Ligne 1893: Ligne 1927:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que sed affiche également tout le contenu du fichierCeci implique que les lignes 1 et 2 s'affichent deux fois.+**Important**: As you can see in the above output, the command used displays not only the first two lines but **also** the entire fileAs a result the first two lines are displayed twice.
 </WRAP> </WRAP>
  
-Pour n'afficher que les lignes spécifiéesil convient d'utiliser l'option **-n** :+To force sed to **only** display the lines you specifyuse the **-n** switch:
  
 <code> <code>
Ligne 1904: Ligne 1938:
 </code> </code>
  
-La commande **w** permet d'écrire dans un fichier. Par exemple pour écrire dans le fichier **/tmp/sedtest** toutes les lignes du fichier **/etc/services** ne commençant pas par le caractère **#**, il convient d'utiliser la commande suivante :+Now you want to use sed to strip out the comments from **/etc/services** and save the result to **/tmp/sedtest** without displaying anything on standard output:
  
 <code> <code>
 [root@redhat9 ~]# sed -n '/^#/!w /tmp/sedtest' /etc/services [root@redhat9 ~]# sed -n '/^#/!w /tmp/sedtest' /etc/services
 +
 [root@redhat9 ~]# more /tmp/sedtest [root@redhat9 ~]# more /tmp/sedtest
  
Ligne 1932: Ligne 1967:
 ftp             21/tcp ftp             21/tcp
 ftp             21/udp          fsp fspd ftp             21/udp          fsp fspd
---Plus--(0%)+--More--(0%)
 </code> </code>
  
-La commande **s** permet de procéder à une substitution :+<WRAP center round important 60%> 
 +**Important**: In the above command, we start by matching all lines in the /etc/services file that start with a #. We then tell sed to write all non-matching lines to the file /tmp/sedtest. 
 +</WRAP> 
 + 
 +Finally, create a file containing **user1,user2,user3**. Replace the commas by spaces:
  
 <code> <code>
Ligne 1944: Ligne 1983:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que dans cet exemple, la commande est suivi par un argument qui prend la forme /ce qui est à remplacer (caractèrechaîne ou ERb)/chaîne de remplacement/g. Le caractère force le remplacement de toutes les occurrencesSans elle, uniquement la première occurrence serait remplacée. Dans le cas de l'exempleon remplace donc les virgules par des espaces.+**Important**: The above sed command has the following format **s/what is to be replaced (characterstring or BRE)/replacement/g**The use of the **g** character forces sed to replace all occurences that matchIf **g** is not stipulatedonly the first matching occurence is replaced.
 </WRAP> </WRAP>
  
-====Présentation de La Commande awk====+====The Text Processor AWK====
  
-Le processeur de texte **awk** est un **filtre**. Une **action** awk est fournie sur la ligne de commande entourée de ' ou de " :+===Presentation===
  
-<file> +The **awk** command acts as a **filter** and uses the following syntax:
-awk [-F séparateur] 'critère {action}' [fichier1 ... fichiern] +
-</file>+
  
-<WRAP center round important 60%> +  awk [-F seperator] '[condition] {action}' [file]
-**Important** : Le couple critère {action} s'appelle une clause. +
-</WRAP>+
  
-Dans le cas de l'utilisation d'un **script** awk, la syntaxe de la commande devient :+===Field Separation===
  
-<file+file or a text stream is treated by awk as a sequence of recordsBy default each line is a recordAwk analyzes each record, separating that record into fields and then storing the record and fields in variables:
-awk [-F séparateur] -f script [fichier1 ... fichiern] +
-</file>+
  
-===Découpage en champs===+  * $0 contains the record, 
 +  * $1 contains the first field, 
 +  * $2 contains the second field, 
 +  * e.t.c.
  
-awk sait identifier les champs de la ligne soit parce que ceux-ci sont séparés par un espace ou par une tabulation soit parce que la ligne de commande lui identifié le séparateur grâce à l'option **-F**.+Awk interprets space as a separator between fields unless a different separator is specified with the **-F** option.
  
-awk stocke les informations de la ligne dans des variables : +Awk then checks if the condition is met for each record and if soexecutes the action.
- +
-^ Variable ^ Description ^ +
-| $0 | Contient toute la ligne | +
-| $1$2 ... | Contient le premier champ de la ligne, contient le deuxième champ de la ligne ... |+
  
-Par exemple :+For example, the following command takes the standard output of **ls -l** and prints fields 8, 3 and 4 to standard output:
  
 <code> <code>
Ligne 1987: Ligne 2019:
 </code> </code>
  
-Comme vous pouvez constaterawk a extrait du résultat de la commande **ls -l** les champs **nom de l'élément**, **le propriétaire** et le **groupe**.+Since there is no conditionthe action is applied to every record.
  
-Afin de le rendre un peu plus lisiblesaisissez la commande suivante :+To make the output easier to readyou can include spaces between each field:
  
 <code> <code>
Ligne 2001: Ligne 2033:
 </code> </code>
  
-===Critères===+=== Conditions ===
  
-Les **critères** conditionnent l'exécution d'une **action** dans une **clause**.+==A regular expression applied to a record==
  
-Plusieurs types de critères sont possibles. Les plus utilisées sont les suivantes :+  * Format: 
 +    * /regular expression/ {action} 
 +  * Exemple: 
 +    * /hello/ {print $0}
  
-== Une expression régulière valide pour la ligne==+==A regular expression applied to a field==
  
-    * Format: +  * Format: 
-     * /expression régulière/ {instruction+    $n ~/regular expression/ {action
-    * Exemple+    * $n!~/regular expression/ {action} 
-     * /ERe/ {print $0}+  * Examples
 +    * $1 ~/hello/ {print $0} 
 +    $1!~/hello/ {print $0}
  
-==Une expression régulière valide pour un champ==+==Comparisons== 
 +  
 +  * Format: 
 +    * $n operator criteria {action} 
 +  * Example: 
 +    * $1 > 20 {print $0}
  
-    Format: +**Operators**
-     $n ~/expression régulière/ {instruction} +
-     $n!~/expression régulière/ {instruction} +
-    Exemple: +
-     * $1 ~/ERe/ {print $0} +
-     * $1!~/ERe/ {print $0}+
  
-awk sélectionne des lignes en utilisant un opérateur de correspondance ou de non-correspondance :+^ Operator ^ Condition ^ 
 +| < | Less than | 
 +| <= | Less than or equal to | 
 +| == | Equal to | 
 +| != | Different | 
 +| > | Greater than | 
 +| >= | Greater than or equal to |
  
-^ Opérateur ^ Condition ^ 
-| ~ | Correspondance | 
-| !~ | Non-correspondance | 
  
-==Une comparaison==+==Logical Operators==
  
-    * Format: +  * Format: 
-     $n opérateur critère de comparaison {action} +    test1 logical operator test2 {action} 
-    Exemple+  Example
-     * $1 > 20 {print $0}+    * $1 ~/hello/ && $2 > 20 {print $0}
  
-Les opérateurs sont :+**Operators**
  
-Opérateur ^ Condition ^ +Operator ^ Condition ^ 
-Inférieur | +%%||%% | OR 
-%%<=%% | Inférieur ou égal +&& AND 
-== Egal +| ! | NO |
-| != | Différent | +
-| > | Supérieur | +
-| >= Supérieur ou égal |+
  
 +==Built-in Variables==
  
-== Un opérateur logique==+  * Format: 
 +    * expression1, expression2 {instruction} 
 +  * Example: 
 +    * NR==7, NR==10 {print $0}
  
-    Format: +**Variables**
-     test1 opérateur logique test2 {action} +
-    Exemple: +
-     $1 ~/ERe/ && $2 > 20 {print $0} +
- +
-Les opérateurs sont : +
- +
-^ Opérateur logique ^ Condition ^ +
-| %%||%% | OU | +
-| && | ET | +
-| ! | NON | +
- +
-==Une variable interne== +
- +
-    * Format: +
-     * expression1, expression2 {action} +
-    * Exemple: +
-     * NR==7, NR==10 {print $0} +
- +
-Les variables sont :+
  
 ^ Variable ^ Description ^ ^ Variable ^ Description ^
-| NR | Nombre total de lignes +| NR | Total number of records 
-| NF | Nombre total de champs +| NF | Total number of fields 
-| FILENAME | Le nom du fichier en entrée +| FILENAME | Name of current input file 
-| FS | Le séparateur de champs en entrée. Par défaut un **espace** ou une **tabulation** | +| FS | The field separator, by default a **space** or **tab** | 
-| RS | Le séparateur de lignes en entrée. Par défaut une **nouvelle ligne** | +| RS | The record separator, by default **newline** | 
-| OFS | Le séparateur de champs en sortie. Par défaut un **espace** | +| OFS | Output field separator, by default a **space** | 
-| ORS | Le séparateur de lignes en sortie. Par défaut une **nouvelle ligne** | +| ORS | Output record separator, by default **newline** | 
-| OFMT | Le format numérique. Par défaut "%.6g" |+| OFMT | Numeric output format, by default"%.6g" |
  
-===Scripts awk===+===Awk Scripts===
  
-Quand un programme awk comporte plusieurs **clauses** composées de **critères** et d'**actions**il convient de d'écrire un **script awk**Ce script comporte trois sections :+To combine several //clauses// composed of //conditions// and //actions// in the same statementit is advisable to create an //awk script//Awk scripts are comprised of three sections:
  
-  * La section **BEGIN** +  * **BEGIN** 
-    * Cette section est exécutée avant la lecture du script +    * This section is executed once, prior to executing the body of the script 
-  La section **principale** +   * **BODY** 
-    * Cette section contient les clauses +    * This sections contains the clauses to be applied to each line 
-  * La section **END** +  * **END** 
-    * Cette sectione est exécutée une fois à la fin du script+    * This section is executed once, after executing the body of the script
  
-Par exemple :+For example:
  
 <code> <code>
 [root@redhat9 tmp]# cat > scriptawk [root@redhat9 tmp]# cat > scriptawk
 BEGIN { BEGIN {
-  print "Liste des systèmes de fichiers montés"}+  print "List of mounted filesystems"}
 {print $0} {print $0}
 END { END {
Ligne 2103: Ligne 2125:
 </code> </code>
  
-<WRAP center round important 60%> +Now apply the awk script to **/etc/fstab** :
-**Important** : Dans l'exemple ci-dessus, la ligne [^D] indique que vous devez appuyer simultanément sur les touches <key>CTRL</key> et <key>D</key>+
-</WRAP> +
- +
-Ensuite saisissez la commande suivante :+
  
 <code> <code>
 [root@redhat9 tmp]# awk -f scriptawk /etc/mtab [root@redhat9 tmp]# awk -f scriptawk /etc/mtab
-Liste des systèmes de fichiers montés+List of mounted filesystems
 sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0 sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
Ligne 2151: Ligne 2169:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation de l'option -f qui applique le script awk au fichier donné en argument.+**Important**: Note the use of the **-f** switch which instructs awk to use the script.
 </WRAP> </WRAP>
  
-===La Fonction printf===+===The printf function===
  
-La fonction intégrée **printf** permet de formater des affichages. Elle a la syntaxe suivante :+The integrated function **printf** is used to format output and has the following syntax:
  
 <file> <file>
-printf ("chaine",expression1,expression2,...,expressionn)+printf ("string",expression1,expression2,...,expressionn)
 </file> </file>
  
-**chaine** contient autant de formats qu'il y a d'expressions.+**string** contains as many formats as there are expressions.
  
-Les formats de printf sont, par exemple :+Examples of formats commonly used are:
  
 ^ Format ^ Description ^ ^ Format ^ Description ^
-| %30s | Affichage d'une chaîne (s=string) sur 30 positions avec cadrage à droite +| %30s | Displays a right-justified string of 30 characters 
-| %-30s | Affichage d'une chaîne (s=string) sur 30 positions avec cadrage à gauche +| %-30s | Displays a left-justified string of 30 characters 
-| %4d | Affichage d'un entier sur positions avec cadrage à droite +| %4d | Displays a right-justified decimal number of digits 
-| %-4d | Affichage d'un entier sur positions avec cadrage à gauche |+| %-4d | Displays a left-justified decimal number of digits |
  
-===Structures de Contrôle===+===Control Statements===
  
-awk peut utiliser des structures de contrôle.+awk can use the following control statements:
  
 ==if== ==if==
- 
-La syntaxe de la commande if est la suivante : 
  
 <file> <file>
 if condition {  if condition { 
  
-    commande +    command 
-    commande+    command
     ...     ...
 } }
Ligne 2190: Ligne 2206:
 else { else {
  
-    commande +    command 
-    commande+    command
     ...     ...
 } }
Ligne 2197: Ligne 2213:
 </file> </file>
  
-ou dans le cas d'une seule commande :+or:
  
 <file> <file>
 if condition if condition
  
-    commande+    command
  
 else else
  
-    commande+    command
  
 </file> </file>
  
 ==for== ==for==
- 
-La syntaxe de la structure de contrôle **for** est la suivante : 
  
 <file> <file>
-for variable in liste_variables {+for variable in list {
  
-    commande +    command 
-    commande+    command
     ...     ...
  
Ligne 2224: Ligne 2238:
 </file> </file>
  
-ou dans le cas d'une seule commande :+or:
  
 <file> <file>
-for variable in liste_variables+for variable in list
  
-    commande+    command
  
 </file> </file>
  
-ou dans le cas d'un tableau :+or in the case of a table:
  
 <file> <file>
-for clef dans tableau {+for key in table {
  
-    print clef tableau[clef]+    print key table[key]
  
 } }
Ligne 2244: Ligne 2258:
  
 ==while== ==while==
- 
-La syntaxe de la structure de contrôle **while** est la suivante : 
  
 <file> <file>
 while condition { while condition {
  
-     commande +     command 
-     commande+     command
      ...      ...
  
Ligne 2258: Ligne 2270:
  
 ==do-while== ==do-while==
- 
-La syntaxe de la structure de contrôle **do-while** est la suivante : 
  
 <file> <file>
 do { do {
  
-     commande +     command 
-     commande+     command
      ...      ...
  
Ligne 2271: Ligne 2281:
 </file> </file>
  
-===Options de la commande===+===Command Line Switches===
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **awk** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **awk** command to view the command line switches.
 </WRAP> </WRAP>
  
-===LAB #6 - Utiliser la Commande awk===+===LAB #6 - Using awk===
  
-Pour illustrer l'utilisation des tableaux, créez d'abord le fichier **sales.txt** :+Create the file **sales.txt**:
  
 <code> <code>
Ligne 2304: Ligne 2314:
 </code> </code>
  
-Ce fichier contient des statistiques de vente par type de PC et par département. +Now create the awk script **sales.awk**: 
- +
-Créez maintenant le script awk **sales.awk** : +
  
 <code> <code>
 [root@redhat9 tmp]# vi sales.awk [root@redhat9 tmp]# vi sales.awk
 +
 [root@redhat9 tmp]# cat sales.awk  [root@redhat9 tmp]# cat sales.awk 
 # BEGIN # BEGIN
Ligne 2326: Ligne 2335:
 </code> </code>
  
-Ce script comporte 13 lignes et a pour but de calculer le nombre total de PC vendus dans les trois départements cités dans le fichier **sales.txt** :+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:
  
 <file> <file>
Ligne 2344: Ligne 2353:
 </file> </file>
  
-Dans ce script vous noterez :+It is important that you understand the key lines in the above script:
  
-  * La ligne **3**, +  * Line **3**, 
-    * Cette ligne se trouve dans la section **BEGIN**. Elle spécifie le séparateur de champs+    * Defines a new field seperator in a BEGIN section. 
-  * La ligne **6**, +  * Line **6**, 
-    * Cette ligne évite le traitement de toute ligne commençant par le caractère **#** ainsi que toute ligne vide+    * Discards all commented and empty lines
-  * La ligne **7**, +  * Line **7**, 
-    * Ce tableau a pour clef la valeur de **$1**, c'est-à-dire, les noms des différents types de PCLe valeurs du tableau sont le nombre de PC vendusici représenté par **$2**. Les caractères **+=** indique qu'à chaque traitement de ligne, le nombre de PC vendus sur la ligne doit être rajouté à la valeur déjà présente dans le tableau+    * The table's key is **$1**, in other words the different types of computersAgainst each keythe number of each type of computer sold is stored in **$2**. The **+=** characters indicate that the value stored in $2 is incremental
-  * La ligne **11**, +  * Line **12**, 
-    * Cette ligne démarre une boucle **for**.7 +    * Uses printf to format the output of each line in the table.
-  * La ligne **12**, +
-    * Cette ligne utilise **printf** afin d'imprimer à l'écran les valeurs calculées et stockées dans le tableau.+
  
-Appliquez maintenant votre script awk au fichier **sales.txt** :+Now execute the script and check the output is correct:
  
 <code> <code>
Ligne 2367: Ligne 2374:
 </code> </code>
  
-====LAB #7 -Autres Commandes Utiles====+====LAB #7 - Other Useful Commands====
  
-===7.1 - La Commande expand===+===7.1 - The expand Command===
  
-La commande **expand** convertit des tabulations dans un fichier en espaces et envoie le résultat à la sortie standardSans fichier en argument ou avec le caractère **-**, la commande prend son entrée de l'entrée standard.+The **expand** command converts tabulations in a file to spaces and prints the results to STDOUTWith no file as an argument or with the **-** character as an argumentthe command takes it's input from STDIN.
  
-Créez le fichier **expand** :+Create the following file:
  
 <code> <code>
 [root@redhat9 tmp]# vi expand [root@redhat9 tmp]# vi expand
 +
 [root@redhat9 tmp]# cat expand [root@redhat9 tmp]# cat expand
 un deux trois quatre cinq un deux trois quatre cinq
Ligne 2388: Ligne 2396:
 un deux trois quatre cinq un deux trois quatre cinq
 un deux trois quatre cinq un deux trois quatre cinq
-</code>>+</code>
  
-Utilisez les option **-vet** de la commande cat pour visualiser les caractères invisibles :+Now use the **-vet** switches of the **cat** command to view the non-printable characters:
  
 <code> <code>
Ligne 2407: Ligne 2415:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Comme vous pouvez constater, les tabulations sont représentées par ^I et les fins de lignes par $. +**Important** : As you can see the tabulations are shown as **^I** and the end of each line as a **$**.
 </WRAP> </WRAP>
  
-Utilisez maintenant la commande **expand** pour convertir les tabulations en espaces en envoyant le résultat dans le fichier **expand1** :+Now use the **expand** command to convert the tabulations into spaces and send the result to the **expand1** file:
  
 <code> <code>
Ligne 2416: Ligne 2424:
 </code> </code>
  
-Visualisez le fichier avec la commande cat et les options **-vet** :+View the resulting **expand1** file with the **cat** command and the **-vet** switches:
  
 <code> <code>
Ligne 2433: Ligne 2441:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Comme vous pouvez constaterles tabulations ont été converties en espaces+**Important** : As you can seethe tabulations have been changed into spaces.
 </WRAP> </WRAP>
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **expand** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **expand** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.2 - La Commande unexpand===+===7.2 - The unexpand Command===
  
-La commande **unexpand** convertit des espaces dans un fichier en tabulations et envoie le résultat à la sortie standardSans fichier en argument ou avec le caractère **-**, la commande prend son entrée de l'entrée standard.+The **unexpand** command converts spaces in a file to tabulations and prints the results to STDOUTWith no file as an argument or with the **-** character as an argumentthe command takes it's input from STDIN.
  
-Utilisez la commande **unexpand** sur le fichier **expand1** et envoyez le résultat dans le fichier **expand2** :+Now use the **unexpand** command to convert the spaces in the **expand1** file into tabulations and send the result to the **expand2** file:
  
 <code> <code>
Ligne 2477: Ligne 2485:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que les espaces ont été remplacés par des tabulations. +**Important** : Note that the spaces have been replaced by tabulations.
 </WRAP> </WRAP>
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **unexpand** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **unexpand** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.3 - La Commande cut=== +===7.3 - The cut Command===
- +
-Chaque ligne est divisée en colonnes. Dans une ligne le premier caractère est dans la colonne numéro **un**, le deuxième dans la colonne deux et ainsi de suite. Dans une ligne il peut y avoir des champs séparés par des tabulations.+
  
-La commande **cut** permet de sélectionner des colonnes et des champs dans un fichierLa commande permet aussi d'utiliser une critère de séparation de champs autre que la tabulation en spécifiant cette critère en utilisant l'option **-d**.+The cut command splits each line of a file into columns starting with column 1Each 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.
  
-Par exemple, pour sélectionner les premières colonnes du fichier **/etc/passwd** la commande est :+Select the first columns of the **/etc/passwd** file:
  
 <code> <code>
Ligne 2535: Ligne 2541:
 </code> </code>
  
-Pour sélectionner les colonnes à 5, les colonnes 10 à 15 et les colonnes 30 et aprèsil convient d’utiliser la commande suivante :+In order to select columns to 5, columns 10 to 15 and columns 30 and higherus the following command:
  
 <code> <code>
Ligne 2578: Ligne 2584:
 </code> </code>
  
-Pour sélectionner les champs 24 et 6 du fichieril convient d'utiliser la commande suivante :+In order to select the 2nd4th and 6th columnuse the following command:
  
 <code> <code>
Ligne 2621: Ligne 2627:
 </code> </code>
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **cut** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **cut** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.4 - La Commande uniq===+===7.4 - The uniq Command===
  
-La commande suivante permet d'extraire du fichier /etc/passwd les GID utilisés en tant que groupes principaux des utilisateurs :+The following command is used to extract the Primary Group GIDs from the **/etc/passwd** file:
  
 <code> <code>
Ligne 2669: Ligne 2675:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation de la commande uniq qui permet de supprimer les doublons dans la sortie triée+**Important**: Note the use of the **uniq** command to remove duplicates from the list.
 </WRAP> </WRAP>
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **uniq** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **uniq** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.5 - La Commande tr===+===7.5 - The tr Command===
  
-La commande **tr** permet de substituer des caractères pour d'autresCette commande n'accepte que des données en provenance de son entrée standard et non en provenance d'un fichier.+The **tr** command is used to substitute certain characters by other charactersThis command **only** accepts data from standard input (hence the pipe):
  
 <code> <code>
Ligne 2723: Ligne 2729:
 </code> </code>
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **tr** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **tr** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.6 - La Commande paste===+===7.6 - The paste Command===
  
-La commande **paste** concatène les lignes de fichiersPar exemple :+The **paste** command concatenates lines from filesFor example:
  
 <code> <code>
Ligne 2774: Ligne 2780:
 </code> </code>
  
- +==Command Line Switches==
-==Options de la commande==+
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **paste** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **paste** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.7 - La Commande split===+===7.7 - The split Command===
  
-La commande **split** est utilisée pour découper de grands fichiers en petit morceaux d'une taille fixe ou d'un nombre de lignes fixe. +The split command is used to divide a large file into smaller segmentsCreate an empty 250 MB file as follows:
- +
-Créez d'abord un fichier d'une taille de 250Mo :+
  
 <code> <code>
Ligne 2794: Ligne 2797:
 </code>  </code> 
  
-Utilisez maintenant la commande **split** pour diviser ce fichier en morceaux de 50 Mo :+Now use the split command to divide the file into 5 smaller files each of 50:
  
 <code> <code>
 [root@redhat9 tmp]# split -b 50m /file filepart [root@redhat9 tmp]# split -b 50m /file filepart
 +
 [root@redhat9 tmp]# ls -l | grep filepart [root@redhat9 tmp]# ls -l | grep filepart
 -rw-r--r--. 1 root root 52428800 Sep 25 16:17 filepartaa -rw-r--r--. 1 root root 52428800 Sep 25 16:17 filepartaa
Ligne 2807: Ligne 2811:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez que cinq morceaux ont été créés dans le répertoire courant. Si aucune taille n'est spécifiée, split devise le fichier en morceaux de 1 000 lignes par défaut+**Important**: Note that the 5 files were created in the current working directory.
 </WRAP> </WRAP>
  
-Reconstruisez simplement le fichier avec la commande cat :+You can re-construct the original file by using the **cat** command:
  
 <code> <code>
Ligne 2820: Ligne 2824:
 </code> </code>
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **split** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **split** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.8 - La Commande diff===+===7.8 - The diff Command===
  
-La commande **diff** indique les modifications à apporter à deux fichiers pour que ceux-ci soient identique+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.
  
-Pour commencer, copiez le fichier **/etc/passwd** vers le répertoire **/root** :+Copy the **/etc/passwd** file to the **/root** directory:
  
 <code> <code>
Ligne 2836: Ligne 2840:
 </code> </code>
  
-Modifiez ensuite le fichier la ligne **trainee** du fichier /root/passwd ainsi :+Edit the ***/root/passwd** file as shown:
  
 <file> <file>
Ligne 2844: Ligne 2848:
 </file> </file>
  
-Supprimez la ligne **tcpdump** dans le fichier /root/passwd et ajoutez en fin de fichier la ligne suivante :+Delete the **tcpdump** entry and add the following line to the end of **/root/passwd**:
  
 <file> <file>
Ligne 2851: Ligne 2855:
 </file> </file>
  
-Comparez maintenant les deux fichiers :+Now compare the two files:
  
 <code> <code>
Ligne 2864: Ligne 2868:
 </code> </code>
  
-Dans cette sortie on constate le caractère **<** et le caractère **>**. Le premier indique le premier fichier qui a suivi la commande **diff** tandis que le deuxième indique le deuxième fichier.+In this output you will notice the **<** and **>** charactersThe first makes reference to the first file, /etc/passwd, whist the second makes reference to the second file, /root/passwd.
  
-Le message **26,27c26** indique qu'il faut changer la ligne 27 dans /etc/passwd afin que celle-ci corresponde à la ligne 26 dans /root/passwd.+The output **26,27c26** means that line 27 needs to be changed in /etc/passwd so that is the same as line 26 in /root/passwd.
  
-Le message **36a36** indique qu'à la ligne 36 dans /etc/passwd il faut ajouter la ligne 36 de /root/passwd.+The output **36a36** means that at line 36 in /etc/passwd line 36 from /root/passwd needs to be added.
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **diff** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **diff** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.9 - La Commande cmp===+===7.9 - The cmp Command===
  
-La commande **cmp** compare les fichiers caractère par caractèrePar défaut la commande s'arrête à la première différence rencontrée :+The **cmp** command compares two files character by characterBy default, the command stops after finding the first difference:
  
 <code> <code>
Ligne 2885: Ligne 2889:
 </code> </code>
  
-L'option **-l** de la commande indique toutes les différences en trois colonnes :+The **-l** switch shows all of the differences in a three column format:
  
 <code> <code>
Ligne 2916: Ligne 2920:
 </code> </code>
  
-La première colonne représente le numéro de caractèrela deuxième la valeur octale ASCII du caractère dans le fichier /root/passwd et la troisième la valeur octale ASCII du caractère dans le fichier /etc/passwd. +The first column represents the character **number**the second column represents the **ASCII octal value** of the character in the **/root/passwd** file and the third column represents the **ASCII octal value** of the character in the **/etc/passwd** file
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **cmp** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **cmp** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.10 - La commande patch===+===7.10 - The patch Command===
  
-La commande **patch** est utilisée pour appliquer des modifications à un fichier à partir d'un fichier patch qui contient les différences entre le contenu de l'ancienne version du fichier et la nouvelle version.+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.
  
-La commande patch n'est pas installée par défaut sous RHEL/CentOS 8 :+The **patch** command is not installed by default in RHEL 9:
  
 <code> <code>
Ligne 2934: Ligne 2938:
 </code> </code>
  
-Rappelez-vous maintenant des modifications apportées aux fichiers /tmp/greptest et /tmp/greptest1 :+If you recall, you made some changes to the /tmp/greptest et /tmp/greptest1 files:
  
 <code> <code>
Ligne 2952: Ligne 2956:
 £ £
 # End comment # End comment
 +
 [root@redhat9 tmp]# cat /tmp/greptest1 [root@redhat9 tmp]# cat /tmp/greptest1
 fenestrOS fenestrOS
Ligne 2962: Ligne 2967:
 </code> </code>
  
-Afin de créer un fichier de patch, il convient d'utiliser la commande **diff** avec l'option **-u** +Now create a patch file containing the modifications that need to be applied to /tmp/greptest in order for it to be identical to /tmp/greptest1:
  
 <code> <code>
Ligne 2968: Ligne 2973:
 </code> </code>
  
-L'examen du fichier de patch démontre les modifications à apporter au fichier **greptest** :+A look at the patch file shows the chnages that need to be made to the **greptest** file:
  
 <code> <code>
Ligne 2991: Ligne 2996:
 </code> </code>
  
-Procédez maintenant à l'application du fichier patch :+Now apply the patch file:
  
 <code> <code>
Ligne 2998: Ligne 3003:
 </code> </code>
  
-Contrôlez maintenant le contenu du fichier **greptest** :+Finally, check the contents of the patched **greptest** file:
  
 <code> <code>
Ligne 3011: Ligne 3016:
 </code> </code>
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **patch** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **patch** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.11 - La commande strings===+===7.11 - The strings Command===
  
-La commande **strings** est utilisée pour trouver toutes les chaînes de caractères qui peuvent être imprimés dans un ou plusieurs fichiers objets ou exécutables passés en argumentUn fichier objet est un fichier intermédiaire intervenant dans le processus de compilation.+The **strings** Command is used to extract any printable string in one or more object files or executablesAn object fie is an intermediary file used when compiling.
  
-Sous Linux et Unix, le format d'un fichier objet est le format **ELF**(//Executable and Linkable Format//). Ce format est aussi utilisé pour :+The format of an object file is **ELF** (Executable and Linkable Format). This same format is also used for:
  
-  * les exécutables+  * executables
-  * les bibliothèques partagés+  * shared libraries
-  * les core dumps.+  * core dumps.
  
-Sans optionla commande **strings** trouve toutes les chaînes d'une longueur de caractères ou plus suivies par un caractère non-imprimable :+Used as isthe command extracts all strings greater than characters in length:
  
 <code> <code>
Ligne 3057: Ligne 3062:
 </code> </code>
  
-L'option **-t** de la commande retourne, en plus des chaînes concernées, la position de décalage pour chaque ligne sur laquelle une ou plusieurs chaînes se trouvent :+Print the offset within the file before each string:
  
 <code> <code>
Ligne 3087: Ligne 3092:
 </code> </code>
  
-L'option **-t** prend un de trois arguments qui indique le système de numérotation à utiliser :+The **-t** switch can take one of three arguments that specify the numbering system to use:
  
-^ Argument ^ Système de Numérotation +^ Argument ^ Numbering System 
-| d | Décimal |+| d | Decimal |
 | o | Octal | | o | Octal |
-| x | Héxadécimal |+| x | Hexadecimal |
  
-L'option **-n** de la commande permet de modifier le nombre de caractères minimales dans les chaînes recherchées :+The **-n** switch prints sequences of characters that are at least **min-len** characters long, instead of the default 4:
  
 <code> <code>
Ligne 3124: Ligne 3129:
 </code> </code>
  
-Dans le cas de l'utilisation de la commande avec plus d'un fichier, l'option **-f** devient très utile. Par exemple, imaginons que vous souhaitez connaître les détails disponibles des Copyright des fichiers dans /bin :+The **-f** switch prints the name of the file before each string:
  
 <code> <code>
Ligne 3221: Ligne 3226:
 </code> </code>
  
-<WRAP center round important 60%> +==Command Line Switches==
-**Important** : Notez que l'option -f a pour conséquence d'imprimer le nom du fichier contenant la chaîne au début de chaque ligne.  +
-</WRAP> +
- +
-==Options de la commande==+
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **strings** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **strings** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.12 - La commande comm=== +===7.12 - The comm Command===
- +
-La commande **comm** est utilisée pour comparer deux fichiers texte. La sortie de la commande sépare les lignes en trois catégories : +
- +
-  * Les lignes présentes seulement dans le premier fichier, +
-  * Les lignes présentes seulement dans le deuxième fichier, +
-  * Les lignes présentes dans la deux fichiers.+
  
-Utilisez la commande **comm** pour comparer les fichiers **/etc/passwd** et **/root/passwd** :+This command compares two text files and prints the differences to standard output:
  
 <code> <code>
Ligne 3294: Ligne 3289:
 </code> </code>
  
-Pour afficher uniquement les lignes présentes dans les deux fichiers, il convient d'utiliser les options **-1** et **-2** :+<WRAP center round important 60%> 
 +**Important**: The lines to the left are those that only appear in the first file. The lines on the right are those that exist in both files. The lines in the middle are those that only exist in the second file. 
 +</WRAP> 
 + 
 +If you only want to see the lines common to both files, use the following command:
  
 <code> <code>
Ligne 3326: Ligne 3325:
 comm: file 1 is not in sorted order comm: file 1 is not in sorted order
 </code> </code>
- +==Command Line Switches==
-==Options de la commande==+
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **comm** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **comm** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.13 - La commande head===+===7.13 - The head Command===
  
-La commande **head** permet d'afficher les **x** premières lignes d'un fichierSans options, la valeur de **x** est de 10 par défaut :+The **head** command is used to display the first **x** lines of a fileThe default value of is 10:
  
 <code> <code>
Ligne 3351: Ligne 3349:
 </code> </code>
  
-Avec l'option **-n**, la valeur de **x** peut être spécifiée :+You can change the default value of x by using the **-n** switch:
  
 <code> <code>
Ligne 3372: Ligne 3370:
 </code> </code>
  
-La commande **head** peut également être utilisée pour afficher les premiers **y** octets en utilisant l'option **-c** :+The command can also be used to display the first **y** bytes of a file by using the **-c** switch:
  
 <code> <code>
Ligne 3383: Ligne 3381:
 </code> </code>
  
-Dans le cas où le **y** est négatifla commande **head** affiche tous les octets du fichier sauf les derniers **y** octets :+If the value of **y** is negative, head displays all bytes in the file **except** the last bytes:
  
 <code> <code>
Ligne 3423: Ligne 3421:
 </code> </code>
  
-Les valeurs **x** et **y** acceptent des multiplicateurs :+Both and can accept multipliers:
  
 <code> <code>
Ligne 3457: Ligne 3455:
 </code> </code>
  
-Les multiplicateurs les plus utilisés sont :+The common multipliers are:
  
-Multiplicateur Valeur en octets ^+Multiplier Number of bytes ^
 | b | 512 | | b | 512 |
 | KB | 1000 | | KB | 1000 |
Ligne 3468: Ligne 3466:
 | G | 1024*1024*1024 | | G | 1024*1024*1024 |
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **head** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **head** command to view the command line switches.
 </WRAP> </WRAP>
  
-===7.14 - La commande tail===+===7.14 - The tail Command===
  
-La commande **tail** permet d'afficher les **x** dernières lignes d'un fichierSans options, la valeur de **x** est de 10 par défaut :+The **tail** command is used to display the last **x** lines of a fileThe default value of is 10:
  
 <code> <code>
Ligne 3492: Ligne 3490:
 </code> </code>
  
-Avec l'option **-n**, la valeur de **x** peut être spécifiée :+You can change the default value of x by using the **-n** switch:
  
 <code> <code>
Ligne 3513: Ligne 3511:
 </code> </code>
  
-La commande **tail** peut également être utilisée pour afficher les derniers **y** octets en utilisant l'option **-c** :+The command can also be used to display the last **y** bytes of a file by using the **-c** switch:
  
 <code> <code>
Ligne 3522: Ligne 3520:
 </code> </code>
  
-Dans le cas où le **y** est positifla commande **tail** affiche tous les octets du fichier à partir de la position de **y**ième octet :+If the value of **y** is positive, tail displays all bytes in the file after the yth byte:
  
 <code> <code>
Ligne 3560: Ligne 3558:
 </code> </code>
  
-Les valeurs **x** et **y** acceptent des multiplicateurs :+Both and can accept multipliers:
  
 <code> <code>
Ligne 3586: Ligne 3584:
 </code> </code>
  
-Les multiplicateurs les plus utilisés sont :+The common multipliers are:
  
-Multiplicateur Valeur en octets ^+Multiplier Number of bytes ^
 | b | 512 | | b | 512 |
 | KB | 1000 | | KB | 1000 |
Ligne 3597: Ligne 3595:
 | G | 1024*1024*1024 | | G | 1024*1024*1024 |
  
-Une option intéressante pour la surveillance des fichiers de journalisation est **-f**. Cette option met à jour l'affichage au fur et au mesure que le fichier est mis à jour :+A useful switch to use with the tail command is **-f**. This switch continually updates the output:
  
 <code> <code>
Ligne 3614: Ligne 3612:
 </code> </code>
  
-==Options de la commande==+==Command Line Switches==
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-**A faire** : Utilisez l'option **--help** de la commande **tail** pour visualiser les options de la commande.+**To do** : Use the **--help** option of the **head** command to view the command line switches.
 </WRAP> </WRAP>
  
-====LAB #8 - Utiliser les commandes ifconfig, grep, tr et cut pour isoler l'adresse IPv4====+====LAB #8 - Use the grep, tr and cut to extract your IPv4 address from the output of ifconfig====
  
 <code> <code>
Ligne 3648: Ligne 3646:
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez l'utilisation de l'option -s avec la commande tr. Cette option permet de remplacer une suite de caractères identiques par un seul caractère+**Important** : Note the use of the **-s** switch with the **tr** commandThis switch replaces a string of identical characters with a single character
 </WRAP> </WRAP>
  
-====LAB #9 - Utiliser les commandes ip, grep, awk et sed pour isoler l'adresse IPv4====+====LAB #9 - Use the grep, awk and sed to extract your IPv4 address from the output of ip====
  
 <code> <code>
Menu