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

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

1 Answer 1

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.