Question
Option 2 : grep -r "failed" /var/log --include="*.log" / grep -r "failed" /var/log --include="*.log"
Detailed Solution
सही उत्तर grep -r "failed" /var/log --include="*.log" / grep -r "failed" /var/log --include="*.log" है।
Question:
Which command searches for the word "failed" inside all .log files under /var/log, including subdirectories? / /var/log के अंतर्गत उपनिर्देशिकाओं सहित सभी .log फ़ाइलों में "failed" शब्द खोजने हेतु कौन सी कमांड है?
Correct Answer: grep -r "failed" /var/log --include="*.log" / grep -r "failed" /var/log --include="*.log"
The -r flag makes grep descend recursively and --include restricts matches to .log files; without -r only the named directory itself (not a file) would be searched. / -r ध्वज grep को पुनरावर्ती रूप से नीचे ले जाता है और --include मिलानों को .log फ़ाइलों तक सीमित करता है; -r के बिना केवल नामित निर्देशिका (फ़ाइल नहीं) खोजी जाएगी।