I have to check whether a random password i generated contains any dictionary words. For this I am using grep into /usr/share/dict/words
How Can I开发者_运维技巧 use grep so as to return me all matches for not only entire expression but also any part of the expression.
example:
grep "foobar" foo
where foo contains text foo should give me a match
echo foo | grep -c --file=/usr/share/dict/words
would yield 1
when there is a match and 0
when there isn't.
精彩评论