Electron microscopy and diffraction with ultrashort pulsed electron beams are capable of imaging transient phenomena with the combined ultrafast temporal and atomic-scale spatial resolutions. The emerging field of optical electron beam control allowed the manipulation of relativistic and sub-relativistic electron beams at the level of optical cycles. Specifically, it enabled the generation of electron beams in the form of attosecond pulse trains and individual attosecond pulses. In this review, we describe the basics of the attosecond electron beam control and overview the recent experimental progress. High-energy electron pulses of attosecond sub-optical cycle duration open up novel opportunities for space-time-resolved imaging of ultrafast chemical and physical processes, coherent photon generation, free electron quantum optics, electron-atom scattering with shaped wave packets and laser-driven particle acceleration. Graphical Abstract.