Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Here's what I'm sure is an easy one, but I can't figure it out.

I have two files:

file1: You are in a maze of twisty little passages, all alike
file2: You are in a maze of twisty little* passages, all alike

I want to perform sdiff on these files, but I want to ignore the * character.

How do I do this?

share|improve this question
up vote 1 down vote accepted

Actually, -I will ignore the whole line I think, not the character. If you want to ignore the character you can:

sdiff <(cat file1 | tr -d '*') <(cat file2 | tr -d '*')

Reference from man sdiff:

-I RE  --ignore-matching-lines=RE
              Ignore changes whose lines all match RE.
share|improve this answer

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.