I have a list of files generated using find that I want to feed (pipe) to cp. My problem is that the files have spaces and apostrophes in them, leading cp to repeatedly complain that it "cannot stat". Is there an elegant solution to this problem?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|
||||
|
Make sure you have -print0 in the find command.
|
|||
|
|
|
Another option is to skip |
|||
|
|
xargs--nullor-0argument. – jasonwryan Sep 23 '12 at 8:25printfcommand or the-printfoption to find? Note thatfind ... -print0is equivalent tofind ... -printf '%p\0'– Keith Thompson Sep 23 '12 at 9:58finduntil I discoveredrsync... – Emre Sep 24 '12 at 5:27