Create, View and Edit Text Files - RHCSA (RH124).pdf

support8872 1,222 views 12 slides Oct 10, 2024
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

Slides on how to create, view and edit text files - Part of RHCSA (RH124) syllabus


Slide Content

Create, View and Edit Text Files

●Text editing tools used for creating, modifying, and viewing
text files within the Linux
●Various types of editors used in linux are Vi/Vim, Emacs, and
Nano

VI/Vim editor:
●Features include :
○Text Manipulation
○Text Replacement
○File Navigation
○String Search & Replace
○Cut & Paste


Linux File Editors

Vi Editor

Modes in vi editor

Command mode
In command mode you will see the filename in the
bottom

Insert mode
●In insert mode you will see ‘--INSERT--’ written in bottom .
●Now , you can add or delete text in file

Execution mode
●Enter execution mode by press Shift + :
●In this, you can save changes, quit the editor, or execute various
commands.
●For e.g- To save type :wq! And press Enter

Search
● In vi editor, press "/" followed by the keyword to search forward.
●To search backward, press "?" followed by the keyword.

Forward search Backward search

Important keys
●i -> Enter insert mode before the cursor
●x ->Delete character under the cursor
●Esc -> Exit insert mode
●dd -> Delete the current line
●u -> Undo the last change
●Ctrl-r -> Redo the last undo
●:/pattern -> Search for a pattern
●:w -> Write (save) the file
●:q -> Quit the editor
●:q! -> Quit without saving changes
●:wq -> Write and quit

Various other editors used in Linux
●Emacs: Highly extensible and customizable text editor with powerful
features, including code editing, macros, and integration with other
tools

●Nano: User-friendly, simple text editor that is ideal for quick edits and
easy navigation, making it a good choice for beginners

Emacs editor

Nano editor