The question says it all. I want to copy files in the terminal, but there are a few big files I don't want to copy (because they are backups). Is there a command to do that?
Something like cp --max-size=200MB
?
I know rsync
has such an option. Is that the way to go?
Try using the
find
command to build a list of files under 200MB and copy them to adir
.Here is how I do it with
rsync
:I would still like to accept an
cp
solution, though.This
didn´t work for me, because it copies all files when it finds a folder, because of the "r" flag on cp. I had to do the following:
Get the list of the files when their size is -200MB
Then, copy the files from the list.txt.
The "cp" and the "--parents" flag will copy the files and create the necessary folder tree.
After that, you have to move the folder to the right place, but it´s simple.
Hope it helps.