In many technological applications, materials are transported by fluid flow at micro/nanometer scales. Conventionally, macroscopic apparatuses, such as syringe pumps, are used to drive the flow. This work explores the possibility of utilizing motile bacteria as microscopic pumps. We used micro-fabricated structures to confine smooth-swimming bacteria in a prescribed configuration. The flagella of confined bacteria rotate to collectively generate flow that can transport materials along designed trajectories. Different structures are combined to realize complex functions, such as collection or dispersion of particles. Experimental findings are reproduced in numerical simulations. Our method opens new ways to generate transport flow at the micrometer scale and to drive bio-hybrid devices.