jamie_lynn
asked on
How can I recursive grep excluding the symlinks?
Hi,
How can I do a recursive grep excluding the symlinks?
Thanks
Jamie
How can I do a recursive grep excluding the symlinks?
Thanks
Jamie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No, symlink is not a directory, it is a file.
Basically, symlink links two files, but if the target is a directory, another file named "source file" is created in target and linked to the original "source file". So eventually links two files as well.
You can do a quick test in /usr/bin directory with the command. Hopefully this answered your question.
You can do a quick test in /usr/bin directory with the command. Hopefully this answered your question.
ASKER
Ah i see.
Thanks!
Thanks!
ASKER
That works
I thought you wanted to do a recursive grep and not a recursive ls.
For a recursive grep excluding symlinks, just do:
find . -type f | xargs grep string
For a recursive grep excluding symlinks, just do:
find . -type f | xargs grep string
ASKER
Would this not go into the symlink directory or just hide the results?
I need grep not even to go into the symlink directory, as there are symlinks that point to itself.
Thanks
Jamie