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:rhel:6:utilisateur:l102 [2020/01/30 03:28] – external edit 127.0.0.1elearning:workbooks:rhel:6:utilisateur:l102 [2023/05/10 16:18] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Last updated on~~LASTMOD~~+Version **2023.01**
  
-======The VIsual Editor======+Updated: ~~LASTMOD~~ 
 + 
 +======LCE402 - The VIsual Editor====== 
 + 
 +=====Contents===== 
 + 
 +  * **LCE402 - The VIsual Editor** 
 +    * Contents 
 +    * Presentation 
 +    * LAB #1 - Creating, Opening and Closing files with VI 
 +      * 1.1 - Commands 
 +      * 1.2 - Creating a new file with VI 
 +      * 1.3 - Opening a file in read-only mode using view 
 +      * 1.4 - Opening a file in read-write mode using VI 
 +    * LAB #2 - The set Command 
 +      * 2.1 - Commands 
 +      * 2.2 - Turning on line numbering using set 
 +    * LAB #3 - Moving around within the file 
 +      * 3.1 - Commands 
 +    * LAB #4 - Inserting Text 
 +      * 4.1 - Commands 
 +      * 4.2 - Inserting text 
 +    * LAB #5 - Searching for Text 
 +      * 5.1 - Commands 
 +      * 5.2 - Searching for and replacing text 
 +    * LAB #6 - Deleting Text 
 +      * 6.1 - Commands 
 +      * 6.2 - Deleting lines 
 +    * LAB #7 - Copy, Cut and Paste 
 +      * 7.1 - Commands 
 +      * 7.2 - Copying, Cutting and pasting text 
 +    * LAB #8 - Configuring a Personalised Interface
  
 =====Presentation===== =====Presentation=====
Ligne 27: Ligne 58:
   * replace existing text.   * replace existing text.
  
-=====Creating, Opening and Closing files with VI=====+=====LAB #1 - Creating, Opening and Closing files with VI=====
  
-====Commands====+====1.1 - Commands====
  
 ^ Command ^ Description^ ^ Command ^ Description^
Ligne 44: Ligne 75:
  
  
-====LAB #1 - Creating a new file with VI====+====1.2 - Creating a new file with VI====
  
 Copy lines 1 through 25 below: Copy lines 1 through 25 below:
Ligne 79: Ligne 110:
  
 <code> <code>
-[trainee@centos7 ~]$ vi vitext+[trainee@centos8 ~]$ vi vitext
 </code> </code>
  
Ligne 86: Ligne 117:
 </WRAP> </WRAP>
  
-====LAB #2 - Opening a file in read-only mode using view====+====1.3 - Opening a file in read-only mode using view====
  
 Now open **/home/trainee/vitext** in read-only mode: Now open **/home/trainee/vitext** in read-only mode:
  
 <code> <code>
-[trainee@centos7 ~]$ view vitext+[trainee@centos8 ~]$ view vitext
 </code> </code>
  
Ligne 134: Ligne 165:
 </WRAP> </WRAP>
  
-====LAB #3 - Opening a file in read-write mode using VI====+====1.4 - Opening a file in read-write mode using VI====
  
 Quit using the **:q** command and open the file in read-write mode : Quit using the **:q** command and open the file in read-write mode :
  
 <code> <code>
-[trainee@centos7 ~]$ vi vitext+[trainee@centos8 ~]$ vi vitext
 </code> </code>
  
Ligne 177: Ligne 208:
 </WRAP> </WRAP>
  
-=====The set Command=====+=====LAB #2 - The set Command=====
  
-====Commands====+====2.1 - Commands====
  
 ^ Command ^ Description^ ^ Command ^ Description^
Ligne 189: Ligne 220:
 | **:set noic** | Turns on case dependent searching | | **:set noic** | Turns on case dependent searching |
  
-====LAB #4 - Turning on line numbering using set====+====2.2 - Turning on line numbering using set====
  
 Turn on line numbering with the command of your choice. You will obtain a result similar to the following example: Turn on line numbering with the command of your choice. You will obtain a result similar to the following example:
Ligne 251: Ligne 282:
 </code> </code>
  
-=====Moving around within the file=====+=====LAB #3 - Moving around within the file=====
  
-====Commands====+====3.1 - Commands====
  
 ^ Command ^ Description^ ^ Command ^ Description^
Ligne 278: Ligne 309:
 </WRAP> </WRAP>
  
-=====Inserting Text=====+=====LAB #4 - Inserting Text=====
  
-====Commands====+====4.1 - Commands====
  
 ^ Key(s) ^ Description^ ^ Key(s) ^ Description^
Ligne 291: Ligne 322:
 | <key>Escape</key> | Returns the editor to //Command// mode | | <key>Escape</key> | Returns the editor to //Command// mode |
  
-====LAB #5 - Inserting text====+====4.2 - Inserting text====
  
 Insert a line under the line 13 using the **o** command. Note that you are now in //Insert// mode. Type the following text : **Linux is super**. You will obtain a result similar to the following example : Insert a line under the line 13 using the **o** command. Note that you are now in //Insert// mode. Type the following text : **Linux is super**. You will obtain a result similar to the following example :
Ligne 392: Ligne 423:
 Switch back to //Commande// mode using the <key>Escape</key> key and move the cursor to the first line of the screen using the **H** command.  Switch back to //Commande// mode using the <key>Escape</key> key and move the cursor to the first line of the screen using the **H** command. 
  
-=====Searching for Text=====+=====LAB #5 - Searching for Text=====
  
-====Commands====+====5.1 - Commands====
  
 ^ Key(s) ^ Description^ ^ Key(s) ^ Description^
Ligne 405: Ligne 436:
 | **:g/**//string//**%%/s//%%**//string1//**/g** | Search and replace //string// by //string1// | | **:g/**//string//**%%/s//%%**//string1//**/g** | Search and replace //string// by //string1// |
  
-====LAB #6 - Searching for and replacing text====+====5.2 - Searching for and replacing text====
  
 Search the text for the string //super// by using the **%%/super%%** command. Now search the next two occurrences using the **%%//%%** command twice. Your cursor should now be at the beginning of the last word on the last line. Search the text for the string //super// by using the **%%/super%%** command. Now search the next two occurrences using the **%%//%%** command twice. Your cursor should now be at the beginning of the last word on the last line.
Ligne 448: Ligne 479:
 </code> </code>
  
-=====Deleting Text=====+=====LAB #6 - Deleting Text=====
  
-====Commands====+====6.1 - Commands====
  
 ^ Key(s) ^ Description^ ^ Key(s) ^ Description^
Ligne 462: Ligne 493:
 | **:5,7 d** | Delete lines 5, 6 and 7 | | **:5,7 d** | Delete lines 5, 6 and 7 |
  
-====LAB #7 - Deleting lines====+====6.2 - Deleting lines====
  
 Place the cursor on the line containing 14 and delete it using the **dd** command. You will obtain a result similar to the following example : Place the cursor on the line containing 14 and delete it using the **dd** command. You will obtain a result similar to the following example :
Ligne 530: Ligne 561:
 </code> </code>
  
-=====Copy, Cut and Paste=====+=====LAB #7 - Copy, Cut and Paste=====
  
-====Commands====+====7.1 - Commands====
  
 ^ Key(s) ^ Description^ ^ Key(s) ^ Description^
Ligne 542: Ligne 573:
 | **:2,3 m 7** | Move lines 2 to 3 to lines 6 and 7 | | **:2,3 m 7** | Move lines 2 to 3 to lines 6 and 7 |
  
-====LAB #8 - Copying, Cutting and pasting text====+====7.2 - Copying, Cutting and pasting text====
  
 Move the cursor to line 3 and copy it using the **yy** command. Move to line 5 and paste the line using the **p** command: Move the cursor to line 3 and copy it using the **yy** command. Move to line 5 and paste the line using the **p** command:
Ligne 679: Ligne 710:
 </code> </code>
  
-=====Configuring a Personalised Interface=====+=====LAB #8 - Configuring a Personalised Interface=====
  
 VI can be configured by any user to suit his/her requirements. This is achieved by creating and editing the file **~/.exrc**. The file is read by VI each time it is launched by that user and the commands contained in it are executed. The format of each command is the same as if it were typed by the user within VI //except// that the leading **:** character is omitted. For example the following .exrc file would tell VI to turn on line numbering and show hidden characters:  VI can be configured by any user to suit his/her requirements. This is achieved by creating and editing the file **~/.exrc**. The file is read by VI each time it is launched by that user and the commands contained in it are executed. The format of each command is the same as if it were typed by the user within VI //except// that the leading **:** character is omitted. For example the following .exrc file would tell VI to turn on line numbering and show hidden characters: 
Ligne 695: Ligne 726:
  
 <code> <code>
-[trainee@centos7 ~]$ vi vitext+[trainee@centos8 ~]$ vi vitext
 </code> </code>
  
Ligne 730: Ligne 761:
  
 ----- -----
-<html> +Copyright © 2023 Hugh Norris.
-<div align="center"> +
-Copyright © 2004-2019 Hugh Norris.<br><br> +
-</div> +
-</html> +
Menu