Viruses are generally written to attack specific platforms. So, a Windows virus
generally cannot attack a Linux-based PC.
What follows is my personal opinion:
Because Linux makes up such a small share of the over-all PC population, it's
not worth the virus writers' time to attack Linux. Same thing applies for
Apple. What the virus writers are after is notoriety and bragging rights. The
best way to ensure that is to attack the biggest target. Sure, in some cases
the virus writers are intent on causing damage to a specific target group but
that's by far a minority of cases.
A second reason is that most Linux users are more computer literate than the
bulk of Windows users and so are less likely to click on the wrong button to
allow bad thing to happen. After all, the vast majority of viral attacks on PCs
require some level of user action for anything to happen.