The Union Army had plentiful rations of food for the time, although, they had to feed over tens of thousands of soldiers, which lead to food shortages. The Confederacy was having lots of difficulty and was trying hard to give full food rations to the troops, but it was difficult due to transportation problems and trying to grow food. There wasn't too much food options during the war, so the most common items on the menu would be hard tack and skillygalee.
Hard Tack was a type of cracker in which it's very thick and very tough to eat, and is sometimes served with pork and butter. Hardtack (like in it's name) Is EXTREMELY hard to bite down on.
Skillygalee was leftover grease poured onto some cornmeal. It was very watery and acted like a type of oatmeal or gruel.
In World War II, the United States developed something called the Victory Garden, which help prevent food shortages. Planting the Victory Gardens helped make sure that there was plenty of food for the soldiers out in war. Foods such as vegetables were packed in cans. Due to the war, most transported foods were harder to get to, so a lot of Victory Gardens were held in local communities. There were over 20,000,000 Victory Gardens placed in the U.S. and was producing 40% of the United State's vegetables. Excess food was canned and used for the winter months so supplements were always available.