Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    use grep. -L is the option you want to use:

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

  3. #3
    Perfect, thanks!

  4. $spacer_open

Posting Permissions

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