Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.