Is there a program to remove trailing spaces and convert tabs to spaces in a lot of files at once using command-line?

I am using cygwin and have a lot of files in which I want to convert tabs to spaces and remove all space characters that exist at end of line. Is there a utility for this in Linux?