Help getting filemask correct for rm command

Advertisement

smithochris
Joined:
Posts:
2

Help getting filemask correct for rm command

Hi,
I have a requirement to remove files from a remote directory that meet the following conditions:
  • are older than 3 days
  • have an extension of *.pgp
  • do NOT contain "KPG" in the file name
I can meet the first 2 criteria with the following:
rm *.pgp<3D
But I'm unable to get the 3rd criteria to work. I've tried this but get an error message:
rm *.pgp<3D|*KPG*
Is this possible to do with the rm command? Thank you for your time.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum