I have a problem with removing files when I find them. Task : must find files with spaces and remove them
my try :)
rm $(find -L /root | grep -i \' \')
<
You can specify an -exec argument to the find command to run a command with the resulting file as an argument. In your case, the following command will do what you want.
-type f will print only files. If you want only directories then use -type d. If you use neither of these then it will print both files and directories.
As this is a delete operation, first run the command and see if it's printing the files you want.
find /root -type f -name '* *'
Then if everything is okay, run this to delete them.
find /root -type f -name '* *' -exec rm {} \;