Deleting

Occasionally, you will reread your document an hour after creating it and decide that you need to delete a character, a word, an entire line, or an entire group of lines. The following lists the commands to handle deletions. Be aware that the dd and dw commands are two of the rare commands that actually require two keystrokes to execute.

The following are the deletion commands:

  • x— Delete the character where the cursor is

  • dw— Delete the word where the cursor is

  • dd— Delete the line where the cursor is

Suppose you make a deletion and realize that it wasn't what you really wanted to do. The vi editor allows you to undo the last command you executed by using the u command. The u command actually takes the contents of the delete buffer (called ...

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.