Find the answer to your Linux question:
Results 1 to 2 of 2
I use the command ln -s a lot to create symbolic links. The problem is that I need to run a routine that looks for a specific string in ALL ...
  1. #1
    Just Joined!
    Join Date
    Apr 2003
    Posts
    52

    distinguishing a virtual vs. physical folder

    I use the command ln -s a lot to create symbolic links.

    The problem is that I need to run a routine that looks for a specific string in ALL of my websites and I'd do it somehting like this:

    Code:
    cd /home
    grep -R "function_enhanced_mail_v100.php" *
    however, it's going to recurse all the "folders" and include symbolic links which I don't wish to do. Is there any way to prevent this?

    Thanks,
    Samuel

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    I would use the find command, which can be set to search or skip symbolic links to directories, and tell it to execute the grep command on files it finds if necessary.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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