removing whitespace from file and directory names

kirkmiesle

Member
Jan 18, 2004
18
0
151
OHIO
Hello,

I have a bunch of directory names that have a space at the end of them. I need to remove this space, but there are 100's of directories and would like to write a script or run something on the command line that will trim these names (it would be even better if I could do this recursively).

I've searched all over for a solution, and can't seem to fine one - does anybody have a suggestion? Since it's only one space, trimming only the last character of the directory name would probably suffice.

Thanks
Kirk