The Phreak Geek!

Search This Blog

Sunday, October 13, 2019

Remove lines using vim

To remove all the lines in vim that contain certain string execute:
:g/string/d

To do the opposite i.e remove the lines that do not contain certain string execute:
:v/string/d
Posted by ash_ishh_
Labels: #c0d
Newer Posts Older Posts Home

Follow @ash_ishh_

Blog Archive

  • ►  2024 (1)
    • ►  June (1)
  • ►  2022 (1)
    • ►  February (1)
  • ►  2021 (4)
    • ►  October (2)
    • ►  January (2)
  • ►  2020 (5)
    • ►  November (1)
    • ►  April (1)
    • ►  February (1)
    • ►  January (2)
  • ▼  2019 (5)
    • ▼  October (1)
      • Remove lines using vim
    • ►  July (2)
    • ►  April (1)
    • ►  March (1)
  • ►  2018 (16)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (11)