Trying to zip and automatically delete files with "find" and "zip -m" on Linux

Viewed 7587

there are over 300000 files in the /test folder with a long name (over 30 character )and same header like this "TEST_*" i want to zip all the files into a .zip package and remove them from the /test file. so i used the command show as below:

find ./test -name "TEST_\*" -mtime +1 | zip -m /home/TESTbac.zip -@;

but the files in the /test folder still exist after i run the shell script

what i want to ask is why the files still exist after running the script ? and how can i fix this problem ?

3 Answers
zip -rm files.zip *.xml

This works perfectly

Related