Find all log file which modified 24 hours ago and compress into zip file

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

— by TrongTan124 on Nov. 9, 2018, 10:04 a.m.


-type f: only file

-mtime +n: File's data was last modified n*24 hours ago

-name "*.log": file have extend .log, can replace other word

zip -m {}.zip: compress all file into zip

/dev/null &: skipping print screen.