Find the answer to your Linux question:
Results 1 to 3 of 3
Need to make sure a security line is added in to every webpage on a site, trying to find out how to list only the filenames of the pages that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    4

    How to find files with missing text


    Need to make sure a security line is added in to every webpage on a site, trying to find out how to list only the filenames of the pages that are missing the text.

    awk or grep?

    So what I want is to list all files NOT containing the word 'securemasthead'

  2. #2
    Just Joined!
    Join Date
    Feb 2006
    Posts
    7
    use grep. -L is the option you want to use:

    Code:
    $ echo 'test1' > test1.txt
    $ echo 'test2 securemasthead' > test2.txt
    $ grep -L securemasthead *
    test1.txt
    $ grep -l securemasthead *
    test2.txt
    if you need to grep in a directory structure, also add -R option

  3. #3
    Just Joined!
    Join Date
    Feb 2007
    Posts
    4
    Perfect, thanks!

Posting Permissions

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