Server Fault is a question and answer site for system and network administrators. 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

I want to list the files that exists in both directory A and B,

so that both




How to do that?

share|improve this question
Look at [this][1] question [1]:… – Selivanov Pavel Oct 18 '11 at 11:33

Try this:

$ comm -12 <(ls A) <(ls B)
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.