AD2IWFB6.txt An_Important_File.txt BB0IA29Q.txt C2MMT30I.txt CANTDELETETHISONE.txt Y9S29CC0.txt z.doc ZZQ0LII7.txtlist the ALL CAPS files which are eight characters long, with or without numbers included, and ending in ".txt" like so:
$ ls -1 | ack ^[A-Z0-9]{8}\.txt$ AD2IWFB6.txt BB0IA29Q.txt C2MMT30I.txt Y9S29CC0.txt ZZQ0LII7.txt(find -regex had a problem with the regular expression, so just went with ack instead. ack -g REGEX didn't match the regex either, perhaps because it matches based on both the relative path and filename?)
$ ls -1 | ack ^[A-Z0-9]{8}\.txt$ | xargs rm
/nix | Oct 07, 2011