I am trying to collect all the files under the current directory and all the subdirectories to one directory. I am trying something like the following
find -type f -exec mv {} collection/{} \;
the above command won't work because the second {}
gives the full path, how can I collect all the files?
Remove the {}
from mv
, mv
will take it as target directory ignoring any parent directories:
find -type f -exec mv {} collection/ \;
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments