Coughing up green stuff indicates that the mucus in the lungs is very concentrated. Gooey, thick mucus is often green, according to an article from WebMD. It is a common misconception that green or yellow mucus is a definitive sign of infection or related to bacteria.
While coughing up green stuff can certainly indicate the presence of either a viral or bacterial infection, microbiologists believe it is related to the release of certain enzymes by the white blood cells, according to Ohio State University. These enzymes, known as myelo-peroxidases, contain iron and help break down bacteria. It is the iron content in the enzymes that contribute to the green or yellow color of the mucus. The longer mucus is allowed to stay in the sinuses or respiratory tract, the likelier it is to appear colored. Mucus often looks greener in the morning because it has become stagnant while sitting in the nose or lungs during the night.
Although antibiotics are not always prescribed when one coughs up green mucus, they may be warranted when the mucus is purulent, or contains pus. Antibiotics are only effective in the treatment of bacterial infections. When administered to treat viral infections, they do little to resolve symptoms or clear the infection. Green mucus can linger for a few days or even weeks, according to Health.com.