Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

So I am stuck here:

grep -E '^....c...c...$' shows all words with the expr I need. Now from this words I only need the ones that don't have a x.

Who can help me?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Use a second grep:

grep -E '^....c...c...$' | grep -v x

Or character classes:

grep -E '^[^x][^x][^x][^x]c[^x][^x][^x]c[^x][^x][^x]$'
share|improve this answer
ok that is the answer – bluewhile Nov 25 '12 at 18:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.