mv files with | xargs
You could try the -exec
option with find
command,
/etc/apache2/sites-enabled$ sudo find . -maxdepth 1 -type f -exec mv {} /etc/apache2/sites-available \;
For moving files owned by root, you need sudo
permissions.
If you want to use xargs
command then add -I
option to it.
find . -maxdepth 1 -type f | sudo xargs -I {} mv {} /etc/apache2/sites-available/
Ideally you should use -print0 with find, so filenames with spaces don't screw things up.
E.g. this should work :
find . -whatever-flags-go-here -print0 | xargs -r0 mv -t target-directory