1.
find ./ -name '*' | xargs -i mv {} ../test/
find ./ -name '*' | xargs rm -rf
2.Question :
[user@localhost directory]$ mv * ../directory2
bash: /bin/mv: Argument list too long
#Method1 : when file name can be distributed across the alphabet.
[user@localhost directory]$ mv [a-l]* ../directory2
[user@localhost directory]$ mv [m-z]* ../directory2
#Method2: using find and exec commands
[user@localhost directory]$ find $directory -type f -name '*' -exec mv {} $directory2/. /;
find $directory -type f -name '*' -exec scp {} username@servername:/$path/. /;
#Method3: using function
function large_mv ()
{ while read line1; do
mv directory/$line1 ../directory2
done
}
ls -1 directory/ | large_mv