Actions
Feature #772
closed
DC
DC
Using Vi to Remove Entire Lines Beginning With a Specific Character
Feature #772:
Using Vi to Remove Entire Lines Beginning With a Specific Character
Description
One common task I do is strip down commented configuration files, and rather than spend a lot of time locating and deleting individual line I find vi to be useful for finding and deleting these lines.
- Open the file to be edited:
vi somefile.txt
- To remove all lines beginning with ; (comment character for PHP config file)
:g/^;/d
- To remove all lines beginning with ; (comment character for PHP config file)
Resources¶
DC Updated by Daniel Curtis almost 10 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
DC Updated by Daniel Curtis over 9 years ago
- Status changed from Resolved to Closed
Actions