Cells of Escherichia coli or Salmonella typhimurium can sense chemicals in their environment and respond by moving toward some and away from others. The ability to sense and swim requires the products of approximately 50 genes, about 10 for detecting and processing sensory cues and the rest for assembly and operation of the flagella. The function of each component in the chemosensory signaling pathway is well understood. Signaling is known to involve phosphorylation of a set of cytoplasmic proteins, but questions remain concerning the protein conformational changes and interactions that take place. Functions have been assigned to almost all of the approximately 40 flagellar proteins, and the sequence of events in flagellar assembly has been largely determined. Flagellar assembly depends on a specialized apparatus for exporting certain flagellar components to their appropriate locations. The structure and mechanism of this apparatus remain a mystery, as does the mechanism by which the flagellar motor generates torque.