0

This question already has an answer here:

I want to move files from one folder to another folder, my code is working fine when file name doesn't contain spaces but if there is a space in a file name then I am getting an error My Code is as follows :

find [folderName] -size +1k -type f -name \*.txt -print0 | while IFS= read -r -d '' file; do
      echo $file
      mv $file targetfolderName    
      done

File Names

sample 01.txt test - copy 01.txt

marked as duplicate by Gilles bash Feb 19 '16 at 23:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Try this

find [folderName] -size +1k -type f -name \*.txt -print0 | while IFS= read -r -d '' file; do
      echo $file
      mv "$file" targetfolderName    
      done

Not the answer you're looking for? Browse other questions tagged or ask your own question.