Not to write their own execution: ls -t | awk -f '-' '{the if (NR> 11) {print $1}} '| xargs rm -f
Aaa - 1.0.0-1. Zip
Aaa - 1.0.0-2. Zip
Aaa - 1.0.0-3. Zip
Aaa - 1.0.0-4. Zip
Aaa - 1.0.0-5. Zip
.
Aaa - 1.0.0-20. Zip
BBB - 1.0.0-1. Zip
BBB - 1.0.0-2. Zip
BBB - 1.0.0-3. Zip
BBB - 1.0.0-4. Zip
BBB - 1.0.0-5. Zip
.
BBB - 1.0.0-50.zip
CCC - 1.0.0-1. Zip
CCC - 1.0.0-2. Zip
CCC - 1.0.0-3. Zip
CCC - 1.0.0-4. Zip
CCC - 1.0.0-5. Zip
.
CCC - 1.0.0-80. Zip
DDD 1.0.0-1. Zip
DDD 1.0.0-2. Zip
DDD 1.0.0-3. Zip
DDD 1.0.0-4. Zip
DDD 1.0.0-5. Zip
.
DDD 1.0.0-100. Zip
CodePudding user response:
General backup is according to the days or weeks, months,According to the days is simple:
The find. - the name "aaa" *.zip "- mtime + 10
The find. - the name "BBB" *.zip "- mtime + 10
The find. - the name "CCC" *.zip "- mtime + 10
The find. - the name "DDD" *.zip "- mtime + 10
CodePudding user response: