Take the 2-minute tour ×
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

A/file_name

B/file_name

exist.

How to do that?

share|improve this question
    
Look at [this][1] question [1]: serverfault.com/questions/39534/… –  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

 
discard

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.