Okay, suppose you have tons of files you need to delete.. so many that you can't open up the folder, or use ls to delete them in one fell swoop. Suppose further that your files are labeled like, "
x_0_0_1_2.dat". Then you can write a loop in you bash terminal as follows:
$ for i in 0 1 2 ; do rm x_${i}_* ; done
The key thing to note here is the curly braces around the iterating variable. If you leave off the braces, it won't work.
$ for i in 3 4 5 ; do rm x_$i_* ; done
bash: /bin/rm: Argument list too long
bash: /bin/rm: Argument list too long
bash: /bin/rm: Argument list too long