Why on earth would you want to do that?!
The only apps that would be *running* in the background would be the essential system services, the app that collects email/SMS messages etc., the music player (if you're listening to music) and any navigation apps (if you're currently using one for navigation). You *want* all of those things running, why would you want to shut them all down?
Or do you mean all the apps that aren't running but are listed in the recent apps list? There's no benefit to closing them unless they've crashed or something - otherwise you just have to wait for them to load again when you next need them, which wastes your time and the phone's battery.