Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Try using the find command to build a list of files under 200MB and copy them to a dir.

find . -size -200M -exec cp -r {} dir/ \;
share|improve this answer
2  
Using -200 is a must, if you leave out the -, you won't get any results. the - indicates 'smaller than' –  BenK May 27 '13 at 20:09
add comment

Here is how I do it with rsync:

rsync --max-size=200MB --progress --verbose --recursive --links --perms --delete --ignore-existing --executability --owner --group --times SOURCE TARGET

I would still like to accept an cp solution, though.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.