Someone correct me if I'm wrong, but if all the files that start with rho_
are of this form, isn't it equivalent to do
rm rho_0.txt rho_*[05]000.txt
Since a number (other than 0) is a multiple of 5000 if and only if it ends in 0000 or 5000.
(0 is a special case, since it is a multiple of 5000, but is typically written without additional leading zeros. If you didn't intend to include 0, then take it out of the above line.)
Of course this should only be used if all the rho_*.txt
files in your directory have the desired form. Don't use it if your directory also contains rho_please_dont_delete_me_5000.txt
.
(Math note: This works precisely because all the prime factors of 5000, namely 2 and 5, are also prime factors of the base we are working in, 10. Equivalently, there is a sufficiently large power of 10 (namely 10000) which is divisible by 5000. There is no similar trick for matching all those which are multiples of 3000.)
ls
first.