Thank you for that solution. But how can I deal with whitespaces?
–
LasallMay 21 '11 at 6:59

1

@Lasall the preferred way is to use find's -exec + (or -exec \;). xargs is only safe to use with the -0 option, which means that you have to tell whatever command you pipe to xargs to delimit the items with NULL-bytes (\0). With find you can do that with -print0. xargs's -0 and find's -print0 are not standard, but -exec is, so if portability is ever an issue, use find with -exec.
–
geirhaMay 26 '11 at 23:29