In this paper, using high resolution transmission electron microscopy, we showed the fabrication of faceted nanopores with various shapes in magnesium by focused electron beam (e-beam). The characteristics of nanopore shapes and the crystallographic planes corresponding to the edges of the nanopores were discussed in detail. Interestingly, by manipulating the e-beam (e.g., irradiation direction and duration), the nanopore shape and size could be effectively controlled along different directions. Our results provide important insight into the nanopore patterning in metallic materials and are of fundamental importance concerning the relevant applications, such as nanopore-based sensor, etc.