How Do You Remove Multiple Lines in Linux?
Contents

How do you delete multiple lines in Unix?

Delete lines other than the first line or header line

Use the negation (!) operator with d option in sed command. The following sed command removes all the lines except the header line.

How do you delete multiple lines in Ubuntu?

10 Answers

  1. use CTRL + Shift + 6 to mark the beginning of your block.
  2. move cursor with arrow keys to end of your block, the text will be highlighted.
  3. use CTRL + K to cut/delete block.
James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest