Delete to the end of the file in vi




















Ask Question. Asked 7 years, 3 months ago. Active 7 months ago. Viewed k times. Note: Using dd is not a good option. There can be many lines. Improve this question. Peter Mortensen 1, 1 1 gold badge 8 8 silver badges 10 10 bronze badges. Cold Cold 3, 5 5 gold badges 12 12 silver badges 11 11 bronze badges. I think dG should work. MadTux, only if you start on the first line.

You are right tripleee — Cold. Show 3 more comments. Active Oldest Votes. Improve this answer. Anthon Anthon 74k 41 41 gold badges silver badges bronze badges. Pro tip. Add a comment. What is the problem with dd? Archemar Archemar I was thinking that using dd i need pess for every line on file.

It's more simple than i expected You need to distinguish between dd the vi command which the OP meant and dd the utility, which you give an example of. Chris Down Chris Down k 22 22 gold badges silver badges bronze badges. Now press x to delete the selected text.

Prakhar de Anand Prakhar de Anand 81 4 4 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science.

Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Use one of the following commands replacing [ ] with the number of lines :. Use the following command and replace [from] with the number of the line where you want the range to start and [to] where you want it to end:.

Note: If you want to customize the look of your Vim console, read our article on working with Vim color schemes. Once you run this command, the text editor will notify you there are --No lines in buffer The following example shows you how it is done. According to the position of the cursor, the text will be removed after running the command.

In this example, we deleted the text in the red box by moving the cursor to the last line we want removed. Vim allows you to delete lines that match a specified pattern. Data Structures. Operating System. Computer Network. Compiler Design. Computer Organization. Discrete Mathematics. Ethical Hacking. Computer Graphics. Software Engineering. Web Technology. Cyber Security. C Programming.

Control System. Data Mining. Data Warehouse. Javatpoint Services JavaTpoint offers too many high quality services.



0コメント

  • 1000 / 1000