Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    48

    Unanswered: linux command help

    hello..
    anyone know the command for searching files with its content
    for eg i want to list all the files with content 'test'

    thnks
    Jagans

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    man grep
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    May 2006
    Posts
    4

    solution

    if u want to search a word in your system then use the following command.
    customize it as per your requirement.
    find / -type f|xargs grep "word"

  4. #4
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    No need to use 'find', If you would have checked the manual for the grep command (man grep) you would have noticed it provides you with an answer:

    grep 'test' MyFile*



    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  5. #5
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Quote Originally Posted by LKBrwn_DBA
    No need to use 'find'
    Yes generally that is true, but watch out for FIFO special files.
    If you don't use find with -type f
    you may think your command is hanging.

  6. #6
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Quote Originally Posted by pdreyer
    Yes generally that is true, but watch out for FIFO special files.
    If you don't use find with -type f
    you may think your command is hanging.
    Yes, but normally a savy Unix user would not locate such files on the same directory as regular files, but otherwise either on /tmp or other special directory.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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