In this work, a relationship between ionospheric TEC anomalies and different earthquake magnitude groups before the main shocks was investigated. For this purpose, 2942 global earthquakes with Mw >= 6 from 2000 to 2019 and possible ionospheric TEC anomalies that occurred before earthquakes were examined by considering 13 different index values of space weather conditions (geomagnetic storm indices and solar activity indices). Anomalies of ionospheric TEC changes were defined for 15-days before and 4-days after the earthquakes by using 15-days moving median method with the length of 15 days. Earthquakes were first grouped according to their magnitudes, and then negative and positive TEC anomalies in quiet days before the earthquakes were detected. These anomalies were observed as similar to 5-13, similar to 5-10, similar to 5-15, similar to 3-13, similar to 7-15, similar to 1 and similar to 5-8 days ago for the earthquakes of 6.0 <= Mw< 6.5, 6.5 <= Mw< 7.0, 7.0 <= Mw< 7.5, 7.5 <= Mw< 8.0, 8.0 <= Mw< 8.5, 8.5 <= Mw< 9.0, and 9.0 <= Mw< 9.5, respectively. Mean of changes in TEC anomalies of these groups is 44.2 % TECU and we detected that the number of positive anomalies in each group is larger than the number of negative anomalies. Consequently, these analyses clearly show that the day-to-day changes in TEC anomalies may supply significant precursors prior to the global earthquakes (M >= 6) in the short-term earthquake prediction for main shocks.