 A typical teleost fish has a streamlined body for rapid swimming , and locomotion is generally provided by a lateral undulation of the hindmost part of the trunk and the tail , propelling the fish through the water . There are many exceptions to this method of locomotion , especially where speed is not the main objective ; among rocks and on coral reefs , slow swimming with great manoeuvrability may be a desirable attribute . Eels locomote by wiggling their entire bodies . Living among seagrasses and algae , the seahorse adopts an upright posture and moves by fluttering its pectoral fins , and the closely related pipefish moves by rippling its elongated dorsal fin . Gobies " hop " along the substrate , propping themselves up and propelling themselves with their pectoral fins . Mudskippers move in much the same way on terrestrial ground . In some species , a pelvic sucker allows them to climb , and the Hawaiian freshwater goby climbs waterfalls while migrating . Gurnards have three pairs of free rays on their pectoral fins which have a sensory function but on which they can walk along the substrate . Flying fish launch themselves into the air and can glide on their enlarged pectoral fins for hundreds of metres . 
