3
 $ find . -type f -mtime +1 -name "*.log" -exec zip -m {}.zip {} \; >/dev/null

Nov. 9, 2018, 10:04 a.m.TrongTan124

Explanation

  • -type f: find only files

  • -mtime +n: file was last modified n*24 hours ago

  • -name "*.log": filename ends with .log

  • zip -m {}.zip: compress file into zip, and delete original file

  • > /dev/null: suppress output