Step 1 : Creating a file
Open terminal.
Vi <filename>.txt
Press i to insert the data in the file.
Step 2: Yanking or Copy
1. Press ESC first to exit the inserting mode.
2. Take the cursor on the line which is to be copied.
3. yy – Yank (copy) the current line, including the newline character.
4. 3yy – Yank (copy) three lines, starting from the line where the cursor is positioned.
5. y$ – Yank (copy) everything from the cursor to the end of the line.
6. y^ – Yank (copy) everything from the cursor to the start of the line.
7. yw – Yank (copy) to the start of the next word.
8. yiw – Yank (copy) the current word.
9. y% – Yank (copy) to the matching character. By default supported pairs are (), {}, and []. Useful to copy text between matching brackets
Step 3 : Paste
Press ESC first to exit the inserting mode.
Take the cursor on the line which is to be pasted.
Command for pasting data in file is press <p>
Step 4 : Delete or Cut
Step 5 : Undo
Press ESC first to exit the inserting mode.
No responses yet