I need to find the files (and path to the files) on my CentOS 7 DirectAdmin server, that contains the string "qunar". So it needs to search all files inside the server.

How can I achieve that?

I tried this, but then the server does not respond, is that because of the heaviness of the search?

grep -i -R "qunar" /
  • Check below mentioned post you will find answer. Click here – Aman Alam May 25 '16 at 20:39
  • Does this have anything to do with Magento? – Robbie Averill May 25 '16 at 20:48
  • 1
    I'm voting to close this question as off-topic because it is about Linux/Unix and not related to Magento – Fabian Schmengler May 25 '16 at 22:16
grep -rnw '/path/to/somewhere/' -e "pattern"

-r or -R is recursive

-n is line number, and

-w stands match the whole word.

-l (lower-case L) can be added to just give the file name of matching files.

In your case grep -rnw '/' -e "qunar"

| improve this answer | |
  • So in my case it will be (grep -rnw '/' -e "qunar")? – JGeer May 25 '16 at 20:47
  • yes in your case grep -rnw '/' -e "qunar" – Aman Alam May 25 '16 at 20:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.