used to treat infections, including pneumonia, and infections of the skin . Linezolid is in a class of antibacterials called oxazolidinones. It works by stopping the growth of bacteria. Antibiotics such as linezolid will not work for colds, flu, and other viral infections.