Project

General

Profile

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

Added by Daniel Curtis almost 10 years ago. Updated over 9 years ago.

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

100%

Estimated time:
0:06 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

DC Updated by Daniel Curtis almost 10 years ago Actions #1

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

DC Updated by Daniel Curtis over 9 years ago Actions #2

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom