Why can antibiotics be used to treat bacterial infections but not viral infections?

Bacteria are living and can be killed through the use of antibiotics. A virus is not living in the first place.