I want to find the common files between the two directories
Dir 1 files
/home/sid/release1>ls -lrt
total 16
-rw-r--r-- 1 sid cool 0 Jun 19 12:53 File123
-rw-r--r-- 1 sid cool 0 Jun 19 12:53 File456
-rw-r--r-- 1 sid cool 0 Jun 19 12:53 FileDEF
-rw-r--r-- 1 sid cool 17 Jun 19 13:11 Fileabc
Dir 2 files
/home/sid/release2>ls -lrt
total 16
-rw-r--r-- 1 sid hot 0 Jun 19 13:02 File456
-rw-r--r-- 1 sid hot 0 Jun 19 13:02 FileDEF
-rw-r--r-- 1 sid hot 17 Jun 19 13:10 Fileabc
I want the output to show the common files between these directories
This works in modern shells, the <(ls a) thing is called process substitution. comm -12 means show only entries that are the same. Play with changing the options for comm: -1 -2 -3 and see. The example is bash syntax.