20 years ago? Knowledge of CO2s effect in the atmosphere has been around since roughly 1896 with Svante Arrhenius.
The Greenhouse Effect
--------------------------------
The greenhouse effect is largely dependent on solar variation. The energy, or radiation, that the Sun sends to the Earth is in the ultraviolet, visible and infrared regions of the electromagnetic spectrum. Solar energy, or energy below 4 micrometers, is collectively known as shortwave radiation while energy above this wavelength is collectively known as longwave radiation. That radiation that strikes Earth's surface is absorbed and re-emitted according to Kirchoff's Law of Thermal Radiation, which states that any object at some non-zero temperature radiates electromagnetic energy. According to Planck's Radiation Law the emitted radiation varies in frequency and wavelength dependent on the temperature of the object. While the Sun emits 99% of it's radiation below 4 micrometers, the Earth, being much cooler than the Sun, emits radiation at a longer wavelength.
Greenhouse gases have the ability to absorb energy at these longer wavelengths. Specifically between 4 micrometers and 100 micrometers. Though absorption of higher energy modes is possible it is largely inconsequential to the greenhouse effect as those frequencies are not emitted by the Earth's surface. When this electromagnetic radiation strikes a molecule with an uneven distribution of electric charges, called an electric dipole, and a matching absorption frequency it causes the molecule to oscillate or vibrate which in turn either re-emits the energy or converts it into kinetic energy. This increase in kinetic energy is what we perceive as an increase in temperature. If a collision with another molecule occurs the energy is again converted into vibrational energy which can then be re-emitted. This interconverting between vibrational energy, kinetic energy and infrared light continues until it can escape into space unimpeded.
Global Warming
-----------------------
There are many lines of evidence showing that the current warming is attributable to an increase of greenhouse gases. Specifically CO2 and methane though other lesser greenhouse gases, such as Ozone and various CFCs, play small roles. CO2 absorbs at a small band centered at 15 micrometers. That is where most of the warming attributable to CO2 is coming from.
You can see the effects global warming has by such things as ecological responses to a warming climate ( http://web4.cns.utexas.edu/communications/File/AnnRev_CCimpacts2006.pdf ) glacial mass balance ( http://www.ibcperu.org/doc/isis/7076.pdf ) and poleward movement of disease vectors ( http://aquaticpath.phhp.ufl.edu/waterbiology/handouts/McMichael_2006.pdf )
Global warming via an increased greenhouse effect is also a reality giving that measurements show that there is more longwave radiation, mainly at CO2 absorption wavelengths, within the troposphere/hydrosphere ( http://journals.ametsoc.org/doi/pdf/10.1175/JCLI4204.1 | http://www.agu.org/pubs/crossref/2009/2009JD011800.shtml ) and upper atmospheric cooling combined with lower atmospheric warming ( http://www.ann-geophys.net/16/1501/1998/angeo-16-1501-1998.pdf ) as well as the rate at which both nights and days are warming ( http://www.knmi.nl/publications/fulltexts/2005jd0062903.pdf )
And we know that the increase in CO2 would not occur without anthropogenic emissions present due to the fact that atmospheric increase, at roughly 15gt per annum, is less than estimated anthropogenic emissions, at roughly 30gt per annum, as well as the 13C to 12C atmospheric ratio ( http://scrippsco2.ucsd.edu/publications/sioref4_2001.pdf ) and O2 atmospheric decrease ( https://bluemoon.ucsd.edu/publications/manning/ManningandKeeling2006.pdf ) on top of that we have ocean decrease in pH during a warming period ( http://www.bu-eh.org/uploads/Main/doney_ann_rev_proof.pdf )