When I use the command grep -R “xxx” in a terminal, the command does not return any results and I know that in the current directory there are files with the term “xxx” inside them
What can I do to get it working again?
Upper/Lower case? “Xxx”, “XXX”
Try using also the -i option to ignore case.
> grep -R **'**xxx**'**
Upper/Lower case or -i option to ignore case do nothing
And you’re executing grep from the top level directory containing the files you wish to examine? (Recursive searches examine the working directory).
Perhaps you needed:
grep -R xxx *
The command works fine here and generates tons of output. Thus I recommend checking again what you are doing. This may be different from what you assume you are doing.
That should not be needed because the man page says that in that case the working directory is searched:
-r, - -recursive
Read all files under each directory, recursively, following symbolic links only if they are on the command line. Note that if no file operand is given, grep searches the working directory. This is equivalent to the -d recurse option.
-R, - -dereference-recursive
Read all files under each directory, recursively. Follow all symbolic links, unlike -r.
But I agree with @karlmistelberger that we have no prove that there is something to be found by grep. In fact the whole isn’t much more then the infamous “it does not work”. And the answers are then as expected, many good meaning suggestions based on guesses and assumptions.
I don’t believe that grep is broken per se, it’s too widely used.
You have access rights to the files? Have you tried with elevated (root) privileges?
They are text and not compressed or binary files?
What search string are you actually using, or are you literally searching for triple x?
Could you show us your invocation of grep? command prompt to command prompt.
Open one of the files in a text editor and use the editor’s search function, does that find the string you are looking for? Perhaps the string isn’t quite in the form you expect it to be.