Find all files (type f) in the current directory (.), with a minimum depth of 1 and a maximum depth of 3, and execute the command 'sed -i 's/\s\+$//' {}' on each of them.
find . -mindepth 1 -maxdepth 3 -type f -exec sed -i 's/\s\+$//' {} \;