Söka text i mappar och filer med Grep

Här är ett kort tips om hur man kan göra sökningar på sin Linux-box med hjälp av grep

This is for future use,

In case if you dont have permission to get into a directory or a file, then you will get a permission denied error amidst the correct matches. You can use the following command to avoid all those errors

find / -name “*” 2>/dev/null | xargs grep -i “search string” 2>/dev/null

By using this, you will get only what matches and saves time. Hope this helps. -Tiger75

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.