I want to compress a directory in Linux. I created a tar.gz that it turns to be a big file, due to the reason that the directory contains some *.o files and some pdf files.
Is there any way to compress a directory but exclude files larger than a predefined SIZE? There is a –exclude argument in tar command, however I would like to reject files larger than 1 MB. This is the constrain, not the name of the file.
In a word, first part of this expression construct a list of files that size is lower than 1024k recursively from ./myRep/ and second part create tar/gzip archive.