When I run the following command:> mkdir some_dir> find /foo/bar/ -name '*.csv' -print0 | xargs -0 mv {} some_dirI get hundreds of lines that say:mv: target `/foo/bar/XX.csv` is not a directoryWhy? I thought xargs would execute:mv /foo/barXX.csv some_dirfor every file that find finds. What's going on? By the way, this is with zshUpdate:Update1:I tried:find /foo/bar/ -name '*.csv' -print0 | xargs -0 mv {} -t some_dirbut then I got a few lines like:mv: cannot stat `{}': No such file or directoryalthough I think the command is moving my files correctly.Update2:I don't seem to need the -t option when using mv alone. For example> touch file1.txt> touch file2.txt> mkdir my_dir> mv  file1.txt  file2.txt  my_dirworks well. Why do I need -t when using xargs? 
Moving files with find + xargs: target is not a directory?
find;xargs
Assuming you have GNU (find, xargs, & mv), change your command to this:$ find /foot/bar/ -name '*.csv' -print0 | xargs -0 mv -t some_direxcerpt from mv man page   -t, --target-directory=DIRECTORY          move all SOURCE arguments into DIRECTORYThe above xargs ... will construct the command so that calls to move will be like this: $ mv 1.csv 2.csv 3.csv ... -t some_dirDon't need xargsYou can skip this approach by just having find do all the work itself:$ find /foot/bar/ -name '*.csv' -exec mv -t some_dir {} +Why do you need the mv -t ...?This has to do with the way that xargs is constructing the set of files to pass to the command it's going to run each time, (i.e. mv ...). When you run the mv command manually yourself you control how many filenames are passed to it and so you don't need to worry about needing the -t my_dir since you always will put the destination directory last.Referencesmv GNU docs[one-liner]: Copying & Moving Files efficiently with xargsWhy does find -exec mv {} ./target/ + not work?