How can I move files with xargs on Linux?
On OS X:
ls file_* | xargs -J {} mv {} temp/
On Linux:
ls file_* | xargs -i {} mv {} temp/
find . -name "file_*" -maxdepth 0 -exec mv {} temp/ \;
find
is better than ls
where there might be more files than the number of program arguments allowed by your shell.
Use -t "specify target directoty" at mv, it should work moving files* to destination directory /temp
ex:- #ls -l file* | xargs mv -t /temp