Connect and share knowledge within a single location that is structured and easy to search. It is working fine. This time the command is taking more time and finally not giving any results. But my files has the content. I have gone through this link - How do I find all files containing specific text on Linux? Is there any issue with my second command? Also is there an alternate command that performs fast? This looks for files whose name finishes with.
With -l L we make the file name to be printed, without the matched line. Ok, so the problem is - XML is not plain text, however similar it looks. It's therefore not really suitable for 'conventional' grepping. Or if you're able to give more specific examples of what your source content and desired outputs are, we can give more specific answers. Anyway, other than that - I wouldn't do a recursive grep, but rather a find -exec.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Leave the double quotes in. The find command will begin looking in the starting directory you specify and proceed to search through all accessible subdirectories.
You may specify more than one starting directory for searching. By default, multiple options are joined by "and". You may specify "or" with the -o flag and the use of grouped parentheses. To match all files modified more than 7 days ago and accessed more than 30 days ago, use:.
You may specify "not" with an exclamation point. To match all files ending in. You can specify the following actions for the list of files that the find command locates:. One of the easiest and fastest methods of locating text contained within a file on a computer running Linux is to use the grep command. Below is a basic example of a command used to locate any htm file containing the word "help". If any matches are found, text similar to the following example is shown.
If no matches are found, nothing is returned, and you'll be placed back at the prompt.
0コメント