grub2mkconfig
grub2-mkconfig is a command-line utility used to generate the GRUB 2 boot menu configuration file, typically grub.cfg. It assembles entries from installed kernels, other operating systems, and recovery options by consulting /etc/default/grub for global settings and the scripts in /etc/grub.d. The tool writes the resulting configuration to the system’s boot directory, typically /boot/grub/grub.cfg (Debian/Ubuntu) or /boot/grub2/grub.cfg (Red Hat/CentOS/Fedora).
How it works: It scans the bootable entries, optionally invoking helpers such as os-prober to detect other
Usage: The exact executable name varies by distribution. grub2-mkconfig is common on Red Hat-based systems, while
Notes: The content of grub.cfg is dynamic and generated from templates and scripts rather than edited directly.