Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vi Question - delete to end of line 1

Status
Not open for further replies.

tbohon

Programmer
Apr 20, 2000
293
US
I can delete to the end of a file but am wondering how to delete to the end of the current line? Have a LOT of lines to process and I don't want to wear out the 'x' key on my keyboard! :)

Tnx in advance.

Tom

"My mind is like a steel whatchamacallit ...
 

Try:

:,.$d



----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Position cursor at point to delete to end of line
press: d$

(for info: d0 will delete to the beginning of the line)


I hope that helps.

Mike
 
Or simply D

Anyway, man vi

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

Oooops, sorry.

I read "end-of-file" instead of "end-of-line". [morning]



----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Thanks, all - I figured it was simple.

And, for the record, I did a 'man vi' before asking this question ... :)

Tom

"My mind is like a steel whatchamacallit ...
 


how bout

:g/$s///g

of if you have ^M at the end of each line

dos2unix <filename> ...what is it that your trying to get rid of ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top