Step 1: Know what we must find.
We need molecules that are linear in shape AND have no lone pair on the central atom. So two things must be true together: the bond angle is $180^\circ$ and the central atom uses all its electrons in bonding.
Step 2: Use a simple shape rule.
By VSEPR theory, lone pairs push bond pairs and bend the molecule. A central atom that forms only two bonds and keeps no lone pair will be straight (linear).
Step 3: Check BeCl2 and HgCl2.
In $\text{BeCl}_2$, Be makes two bonds and has no lone pair, so it is linear and qualifies. In $\text{HgCl}_2$, Hg also makes two bonds with no lone pair, so it is linear and qualifies too.
Step 4: Check the bent ones.
$\text{O}_3$ has a lone pair on the middle oxygen, so it is bent. $\text{SCl}_2$ has two lone pairs on sulfur, so it is bent. $\text{SnCl}_2$ and $\text{PbCl}_2$ each have one lone pair on the central atom, so they are bent. None of these qualify.
Step 5: Watch the tricky XeF2.
$\text{XeF}_2$ looks linear, but Xe carries three lone pairs. The question wants no lone pair on the central atom, so $\text{XeF}_2$ fails this test even though it is straight.
Step 6: Count and conclude.
Only $\text{BeCl}_2$ and $\text{HgCl}_2$ pass both rules. So the count is \[ \boxed{2} \]