Cockroaches live in a wide range of environments around the world. Pest species of cockroaches adapt readily to a variety of environments, but prefer warm conditions found within buildings. Many tropical species prefer even warmer environments and do not fare well in the average household.The spines on the legs were earlier considered to be sensory, but observations of their locomotion on sand and wire meshes has demonstrated that they help in locomotion on difficult terrain. The structures have been used as inspiration for robotic legs. Cockroaches leave chemical trails in their feces as well as emitting airborne pheromones for swarming and mating.
Cockroaches are mainly nocturnal and will run away when exposed to light. Cockroaches are one of the most commonly noted household pest insects. They feed on human and pet food, and can leave an offensive odor. They can also passively transport microbes on their body surfaces including those that are potentially dangerous to humans, particularly in environments such as hospitals, Cockroaches have been shown to be linked with allergic reactions in humans.