Home / Linux  / Find files accroding to size and archive them

Find files accroding to size and archive them

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

Find 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

A Linux Geek with Freelance Contributor, Server/ Cloud Administrator having 6+ Years experience in Open Source and Cloud Technologies.

Review overview
NO COMMENTS

POST A COMMENT