开发者

checking if password contains dictionary words

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜