Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:rhel:6:utilisateur:l102 [2020/01/30 03:28] – external edit 127.0.0.1 | elearning:workbooks:rhel:6:utilisateur:l102 [2023/05/10 16:18] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Last updated on: ~~LASTMOD~~ | + | Version |
- | ======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, | + | =====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: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
</ | </ | ||
Ligne 86: | Ligne 117: | ||
</ | </ | ||
- | ====LAB #2 - Opening a file in read-only mode using view==== | + | ====1.3 - Opening a file in read-only mode using view==== |
Now open **/ | Now open **/ | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
</ | </ | ||
Ligne 134: | Ligne 165: | ||
</ | </ | ||
- | ====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 : | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
</ | </ | ||
Ligne 177: | Ligne 208: | ||
</ | </ | ||
- | =====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: | ||
</ | </ | ||
- | =====Moving around within the file===== | + | =====LAB #3 - Moving around within the file===== |
- | ====Commands==== | + | ====3.1 - Commands==== |
^ Command ^ Description^ | ^ Command ^ Description^ | ||
Ligne 278: | Ligne 309: | ||
</ | </ | ||
- | =====Inserting Text===== | + | =====LAB #4 - Inserting Text===== |
- | ====Commands==== | + | ====4.1 - Commands==== |
^ Key(s) ^ Description^ | ^ Key(s) ^ Description^ | ||
Ligne 291: | Ligne 322: | ||
| < | | < | ||
- | ====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 // | Switch back to // | ||
- | =====Searching for Text===== | + | =====LAB #5 - Searching for Text===== |
- | ====Commands==== | + | ====5.1 - Commands==== |
^ Key(s) ^ Description^ | ^ Key(s) ^ Description^ | ||
Ligne 405: | Ligne 436: | ||
| **: | | **: | ||
- | ====LAB #6 - Searching for and replacing text==== | + | ====5.2 - Searching for and replacing text==== |
Search the text for the string //super// by using the **%%/ | Search the text for the string //super// by using the **%%/ | ||
Ligne 448: | Ligne 479: | ||
</ | </ | ||
- | =====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: | ||
</ | </ | ||
- | =====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: | ||
</ | </ | ||
- | =====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 **~/ | VI can be configured by any user to suit his/her requirements. This is achieved by creating and editing the file **~/ | ||
Ligne 695: | Ligne 726: | ||
< | < | ||
- | [trainee@centos7 | + | [trainee@centos8 |
</ | </ | ||
Ligne 730: | Ligne 761: | ||
----- | ----- | ||
- | < | + | Copyright © 2023 Hugh Norris. |
- | <div align=" | + | |
- | Copyright © 2004-2019 | + | |
- | </ | + | |
- | </ | + |