For those who are wondering, yes, Wine is malware compatible so be careful about the EXEs you run!
I find the Linux ecosystem has far better updating mechanisms than Windows and it doesn’t have as much backwards compatibility cruft as Windows. That and the open source nature I think is better at having exploits uncovered. I’m not saying Linux is perfectly secure, but that it’s more secure than Windows. But I think the biggest reason it’s less likely to get viruses is just that it’s a smaller target and that hackers aren’t spending as much time trying to attack it, plus the users are more tech savvy meaning any attacks will be less lucrative.
it’s a smaller target and that hackers aren’t spending as much time trying to attack it
It’s the most popular server system, so I’m not so sure about that.
The target user base is much smaller. Most viruses are spread through user error and server administrators are far more competent than a typical OS user. Also, typical server exploits lead to exposing credentials rather than spreading viruses.
Software is usually installed from repositories and not random websites, so there is less room for user error in general. Even if you download an executable file, you will most likely have to give it permissions to run first. So I think it’s more immune to viruses not because of its users, but because of the way it’s designed.