Tag Archives: unix

VI frequently used command

While using VI for many years, there are lots of materials in the man page or some other manual all talking about vi. But I did find some commands which are used quite often during my work with *NIX* like operation system (AIX, MAC, LINUX, CYGWIN, etc.).

  1. command mode and input mode switch $>ESC
  2. navigating right #>l
  3. navigation left #>h
  4. navigation up #>k
  5. navigation down #>j
  6. go to line end #>$
  7. go to 50th line #>50G
  8. go to first line #>1G
  9. go to last line $>GG
  10. go to line head #>0
  11. start a new line #>o
  12. delete current line #>dd
  13. copy current line inside vi #>yy
  14. paste line copied inside vi #>p
  15. delete current character #>x
  16. replace current character #>s
  17. insert at current position #>i
  18. page up #>CTRL b
  19. page down #>CTRL f
  20. append at end of current position #>a
  21. reload current file #>:edit
  22. close w/o save the file #>:q!
  23. save the file #>w
  24. save and close the file #>:wq
  25. to remove control m characters (type ctrl v ctrl m for ^M)#>:%s/^M//g
  26. …more coming soon