Find files accroding to size and archive them

Here is a bash script for all files which size is higher than given size in parameter and archive it.

below example.


files=$(find ./ -type f -size +$1c)
#fix names in case there are spaces. Insert \ to escape spaces
techtrname="${files// /\\ }"
tar -czf techtransit.tar.gz $techtrname

About Sachin Gupta

I am a professional freelance contributor and founder of tech transit. Love to write and lover of education, culture, and community. I have been using it, setting, supporting, and maintaining it since 2009. rocks!

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *