Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
grep absolute path
Results 1 to 2 of 2

Thread: grep absolute path

  1. #1

    grep absolute path

    Hi,

    consider that my present working directory(pwd) is /opt/lampp/w3calculator.com/
    from this location I run a grep command as
    Code:
     
    grep 'search string'
    My requrement is to get the absolute path of the search string and store in the a file. how can I do this?

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

  2. #2
    Administrator Advisor peter's Avatar
    Join Date
    Apr 2004
    Posts
    882
    Try:
    Code:
     # grep 'search string' /opt/lampp/w3calculator.com/* > filename.txt

    My sites:
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    -
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Similar Threads

  1. Using grep in my home directory
    By Clai2x in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 12-19-2007, 04:57 AM
  2. Using Grep and regex to pull a value out of a string
    By thestonefox in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 10-24-2007, 03:58 PM
  3. What does 'locate network grep howto' do?
    By Smegma in forum Linux - Software, Applications & Programming
    Replies: 7
    Last Post: 03-28-2004, 04:16 AM
  4. Add to PATH
    By trickster in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 09-28-2002, 10:26 PM
  5. finding a friggin tab with sed or grep
    By morphman in forum Linux - Software, Applications & Programming
    Replies: 13
    Last Post: 04-27-2002, 06:31 AM

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
  •