I am having difficulty using xargs with files with ', is there a way to by pass this problem?

$ find . | xargs -I FILE echo FILE

xargs: unterminated quote

file name

$ ls

mike's sample 16


You may use the NUL character to separate the file names:

$find . -print0 | xargs -0 echo 
| improve this answer | |
  • what if i want to rename them like this | xargs -I FILE mv FILE <new_name> – user2167582 Dec 2 '16 at 5:09
  • @user2167582 if that's what you want to do, look into the -exec parameter of find , that's the preferred way. but if you must use xargs: find . -print0 | xargs -0 -I FILE mv FILE newname, but this will only work if find returns 1 file only. – Dave.d Dec 2 '16 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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