Javatpoint Logo
Javatpoint Logo

vi undo and repeat

In command mode, to undo the last command u is used and if you want to repeat the last command use dot (.).

u

This command allows us to undo or cancel our last command.

Example:

Linux-Undo and Repeat1

Look at the above snapshot, this is our script.

Linux-Undo and Repeat2

Look at the above snapshot, with the help of dG command we have deleted last lines.

Linux-Undo and Repeat3

Look at the above snapshot, after pressing u, last command dG disables and all the content came back.

(.)

The . command allows us to repeat last used command.

Example:

Linux-Undo and Repeat4

Look at the above snapshot, we have used D command to delete some part of line second.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA