Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, how to find the text inside a file. Say i have a word called 'Linux123' in some file. I dont know the file name also; but i want to ...
  1. #1
    Just Joined!
    Join Date
    Jul 2003
    Posts
    17

    To find a word in a file



    Hi,
    how to find the text inside a file.
    Say i have a word called 'Linux123' in some file. I dont know the file name also; but i want to list all the files which contaions the word 'Linux123'. How can i search for the file which contains that word

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Code:
    find / -type f -exec grep -H 'Linux123' {} \;

Posting Permissions

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