Hi,
I have 2 directories, 1st dir with actual files and the 2nd dir with files with zero contents. What command in unix can I use to check for every file in 2nd dir, whether there is a matching filename in 1st dir.If no matching, delete it; if yes, go to next file.
For example,
1st dir:
abc.txt
def.zip
ghi.gds.pgp
2nd dir:
xyz.zip
abc.txt
stu.zip
ghi.gds.pgp
The resulting files in 2nd dir shd be:
abc.txt
ghi.gds.pgp
I have 2 directories, 1st dir with actual files and the 2nd dir with files with zero contents. What command in unix can I use to check for every file in 2nd dir, whether there is a matching filename in 1st dir.If no matching, delete it; if yes, go to next file.
For example,
1st dir:
abc.txt
def.zip
ghi.gds.pgp
2nd dir:
xyz.zip
abc.txt
stu.zip
ghi.gds.pgp
The resulting files in 2nd dir shd be:
abc.txt
ghi.gds.pgp