The objective of dupes is to help people find the right answer. If the right answer can be found under another question, then that is where we should go and we should indeed close one of the two as dupes of the other. Now, the special case where one question includes some specific detail that is not included in the other answer, as Zanna describes in her answer here, is indeed different. If the question isn't fully answered by the dupes of the answer, then only close if the questions themselves are identical.
Generally speaking, my rule of thumb is "Do the answers of the proposed duplicate answer the question?" and if the answer to that is yes, vote to close. For me, whether the questions themselves are the same is almost irrelevant. The point is whether the answers are the same.
So I would strongly disagree with Zanna's second point there:
I also agree with people who say this another way: that it's not enough for the target to have an answer that could work for the proposed dupe question; the question itself must be the same.
For me, the question absolutely doesn't need to be the same, it just needs to be answered by the same answer. If both questions have the same answer, having two separate almost identical answers just because the two questions were approaching the subject from different angles is a waste and makes it harder to actually find the answer.
So I would go with Zanna's first litmus test of "can an answer be posted here that could not be posted on the dupe?" but, if the answer to that question is "no", then we don't need the questions to be the same. For example, consider these trivial example:
How can I delete a file named -foo
? I tried rm -foo
but it gave an error!
and
How can I move a file named -bar? I tried mv -bar baz
but got an error!
The questions are ostensibly different, but the answer in both cases will be to either use command -- filename
or command ./filename
and a good answer could explain what --
does and how to handle file names safely. Even though the questions are different, they should be closed as duplicates as long as we have a good answer.
Or, to take a real example, consider How to add a directory to the PATH?. That has been used as a dupe target for very many questions, some of which appear different. For example:
Each of the dupes is slightly different, some asking about specific directories, others more general, but none are identical. And yet all have been correctly closed as duplicates since the answers of the dupe target also answer the closed questions.
Bottom line, when wondering whether to close, just ask yourself "do the answers of the duplicate adequately answer the current question?" and, if the answer is yes, vote to close.