Results 1 to 4 of 4

Thread: help with vi

  1. #1
    Join Date
    Oct 2005
    Posts
    26

    Unanswered: help with vi

    I have a file that has bout 375 lines. I want to put a rm in front of each line.

    Is there a vi command that will help me accomplish this?

    CougarTrace

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    :%s/^/rm /

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    In case you're curious, here's an explanation:
    Code:
    :       enter command mode
    %       for each line
    s       substitute
    /^      at the beginning of the line
    /rm /   whatever you want

  4. #4
    Join Date
    Oct 2005
    Posts
    26

    thanks

    Thanks. It worked.

    CougarTrace

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •