|MadSci Network: Physics|
I assume that you mean that the filings were attracted to the ends of the bar magnet and not to the sides. The simple answer is that the field is much stronger at the ends of the magnet than it is at the sides. A more complete answer is that the magnetic force on an iron particle is proportional to the field times the rate at which the field is changing as a function of distance. The latter is called the "field gradient". At the ends of the magnet the field and the field gradient are both large and the forces is very strong. At the sides of the magnet, the field is smaller and the field gradient very small. Hence the force there is small. The ends of the magnet attract most of the particles, leaving very few at the sides. [note added by MadSci Admin: There are also some previous answers in our archives which discuss bar magnets. They can be found by searching with our search engine which is at http://www.madsci.org/MS_search.html]
Try the links in the MadSci Library for more information on Physics.