Project

General

Profile

Feature #772

Using Vi to Remove Entire Lines Beginning With a Specific Character

Added by Daniel Curtis over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Shell Scripts
Target version:
Start date:
03/08/2016
Due date:
% Done:

100%

Estimated time:
0.10 h
Spent time:

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
      

Resources

#1

Updated by Daniel Curtis over 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
#2

Updated by Daniel Curtis over 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF