Results 1 to 3 of 3

Thread: Finding a comment or directive I've used in a file

  1. #1
    Join Date
    Mar 2013
    Beans
    12

    Finding a comment or directive I've used in a file

    I typed a comment in a file (using "#" of course) on my linux server, but i can't remember where i put it. is there a way to find a term, word or directive (such as <Limit>) that i've used?

  2. #2
    Join Date
    Mar 2011
    Location
    Goshen, IN
    Beans
    396
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Finding a comment or directive I've used in a file

    Use grep.

    Code:
    grep -r -I 'string you're searching for' /*
    That will search starting at '/' recursively through all files, ignoring binary files. It will take a while.

    If you remember which directory you put the file in, or the extension of the file, that will speed up the search.

    For more options,

    Code:
    man grep
    Last edited by Derek Karpinski; March 27th, 2013 at 06:05 PM.

  3. #3
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Finding a comment or directive I've used in a file

    It helps to use your initials in your comments:

    # TFG 27 Mar 13 Cheesy work around, because I'm too lazy to refactor this code.
    #
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

Bookmarks

Posting Permissions

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