I am trying to get all the .json files within a certain directory path, and to check if within each of the files found, if it contains a certain keyword. In this case, the keyword I am looking for is called "case_control".
So while I perform a very simple scenario - creating a few json file, some embedded with the keyword, it seems to run and is fast. However as soon as I run the code in the actual directory path that I want test it onto, it is taking quite some time.. like 2+ hours and it is still 'running'
Is my code wrong or does it simply works slow in linux?
This is the command I am using:
find /serverA/data -type f -name "*.json" | grep -rn "case_control" /serverA/data