Vacuum your shag rug regularly. Clean it twice a week to keep it in tip-top shape.
Sweep area rugs that are not too large with a bristle broom. The broom bristles get down into the pile and push the dirt out.
Paddle your not-too-large area rugs by rolling them up, shaking them outdoors and then throwing them over a clothesline. Then use a paddle to knock the dirt out of them.
Rent a shampoo machine at a local stare. Do this once every six months for best results. Your local supermarket or super center should have carpet shampoo machines available.
Hire a professional service if you don't want to shampoo the rug yourself. Look the yellow pages under "Carpet Cleaners" to find services in your area.