< Browse > Home / Linux / Blog article: Vi/Vim tips – Delete Lines

| RSS

Vi/Vim tips – Delete Lines

July 1st, 2009 Posted in Linux

1.) Delete present line

Goto the line you want to start delete, press

Esc dd # Will delete present line

2.) Delete from line 1 to end of line.

:1,$ del # Delete from line 1 to EOL

3.) Delete from present line to end of line.

:.,$ del # Delete from present line to EOL

or

Goto the line you want to start delete, press

Esc d Shift g # Will delete all the lines from present line to EOL

. -> present line

1 -> line 1

$ -> End of Line

del -> Delete

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • MySpace
  • Twitter
Related Posts
  • No Related Posts
Tags:

Leave a Reply

blog comments powered by Disqus

World Vision / WWF

World Vision
One Life - Do Something
I support WWF

Subscribe

Follow Me Twitter Follow Me Friendfeed Subscribe RSS to receive content updates in your favorate reader
Follow Me Facebook Follow Me LinkedIn
RSS Subscribe in a reader
RSS Or, subscribe via email:
     

Recent Post

    • [Centos] Kickstart (Unattended) Linux OS installation
    • Singtel Iphone 4 Launching Date
    • Create Bootable USB Drive For Centos Installation
    • PC Server For Research
    • I’m Back Again

Popular Post