In hermit crabs, the fourth and particularly the fifth pereopods are reduced, usually remaining within the confines of the gastropod shell and hence are not used for walking. These appendages do however becoming important when the hermit crab attempts to right itself, providing anchorage within the shell. Further, the fifth pereopod has become specialised as a gill cleaning appendage, often resting within the gill chamber (Bauer 1981). On the abdomen only the left pleopods are retained (Poore 2004).
Hermit crabs used specialized setae on the third maixillipedes and fifth pereiopods for most grooming but used the unmodified first, second, and third pereiopods as well. Most brachyuran grooming was performed with modified setae on the the third maxillipedal palps and eipods, with a row of simple setae on each chelipede merus, and with the chelipede fingers.
The third maxillipedes and fifth pereiopods performed the majority of movements, including all of the more complex actions, and were suprisingly dexterous. Coenobita clypeatus devoted most of it’s grooming energy on the eyes and anntennules and did so with the mesial surfaces of the dactylus, propodus, carpus, and distal merus of the third maxillipedal endopods.
The three pairs of walking legs (chelipedes included) groomed themselves by scrubbing against each other in various combinations of two or three appendages. In addition, the fingers of the minor chelipede picked at the surface of the major chelipede. The chelate fifth pereiopods were quite flexible and extended as far forward as the chelipedes. The fifth pereiopods also groomed most of the central and posterior carapace, including the branchial chamber, and much of the abdomen. The fifth peeriopods groomed much of the shell’s interior, particularly the columella and innner and outer lips, as well as the exterior lips.These appendages did not function exclusively as grooming organs, as they also use their laterally situated gripping scales to brace the body against the shell (Johnson 1965, Vuillemin 1970).
After every few grooming acts, the fifth pereiopods moved anteriorly, in unison. to meet the two third maxillipedes, which were extended posteriorly beneath the body. The plumodenticulate and serrate setai of the posterior appendages were then scrubbed by the maxillipedes. The third maxillipedes, in turn, were scrubbed against each other and/or against the second maxillipedes after a grooming bout. The interior mouthparts had a self-cleaning function as well.
Thus, the maxillipedes groomed the anterior portion of the body (especially the sensory structures), the walking legs groomed each other, and the fifth pereiopods scrubbed the most posterior areas. Two movements were, at times, performed simulanteously, e.g., mutual leg scrubs and anntennule grooming. Although grooming may occur at any time, it was most frequentl and intense immediately after a ran and was often performed in standing water if it was available. Water is clearly an important debris-flushing medium. The grooming setae, parrticuarly the serrate setae, may also serve in a sensory capacity (Derby 1982).
Foam bathing, in which bubbles produced by the mouthparts disperse fluid about the body, occurred in partially submerged or emergent crabs. This action has been variously interpreted as a method of thermoregulation, pheromone distribution, water reserve aeration, or cleansing (Altevogt 1968, Wright 1966, Lindberg 1980, Jacoby 1981, Schone & Schone 1963, Brownscombe 1965). 
Dardanus megistos by Storm Martin 2012
2. Grooming structure and function in some terrestrial Crustacea