vim – delete comments and empty lines

vim – delete comments and empty lines

  • mdo  Tom
  •  
  •   August 12, 2022

Hi, today in english because .. more people can read this in the world 😉

How to delete comments and empty lines in a config-file in linux?
No Problem, do this in vi/vim:

:g/^\#/d

This deletes lines beginning with #

:g/^$/d

and this will delete lines beginning with empty space.

Now try this and have much fun with short config-files 😉

Have a nice day

bash debian linux manjaro pi raspberry shell vi vim


OMVS ©

2023