As the hermit crab grows in size, it must find a larger shell and abandon the previous one. This habit of living in a second-hand shell gives rise to the popular name "hermit crab", by analogy to a hermit who lives alone. Several hermit crab species, both terrestrial and marine, have been observed forming a vacancy chain to exchange shells. When an individual crab finds a new empty shell it will leave its own shell and inspect the vacant shell for size. If the shell is found to be too large, the crab goes back to its own shell and then waits by the vacant shell for up to 8 hours. As new crabs arrive they also inspect the shell and, if it is too big, wait with the others, forming a group of up to 20 individuals, holding onto each other in a line from the largest to the smallest crab. As soon as a crab arrives that is the right size for the vacant shell and claims it, leaving its old shell vacant, then all the crabs in the queue swiftly exchange shells in sequence, each one moving up to the next size. Hermit crabs often "gang up" on one of their species with what they perceive to be a better shell, and pry its shell away from it before competing for it until one takes it over.