grub-mkconfig
system managementLinux
The grub-mkconfig command is one of the most frequently used commands in Linux/Unix-like operating systems. grub-mkconfig Generate a GRUB configuration file
Quick Reference
Command Name:
grub-mkconfig
Category:
system management
Platform:
Linux
Basic Usage:
grub-mkconfig [options] [arguments]
Common Use Cases
Syntax
grub-mkconfig [options]
Options
Option | Description |
---|---|
-o, --output=FILE |
Output generated config to FILE [default=stdout] |
-h, --help |
Display help information and exit |
-v, --version |
Output version information and exit |
Environment Variable | Description |
---|---|
GRUB_DEFAULT |
Default menu entry (name, index, or 'saved') |
GRUB_TIMEOUT |
Time to wait before booting default entry |
GRUB_CMDLINE_LINUX |
Command-line arguments for Linux kernel |
GRUB_DISABLE_OS_PROBER |
Disable os-prober for detecting other OSes |
GRUB_DISABLE_RECOVERY |
Disable generation of recovery mode menu entries |
GRUB_DISTRIBUTOR |
Distributor name for menu entries |
Examples
How to Use These Examples
The examples below show common ways to use the grub-mkconfig
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
grub-mkconfig -o /boot/grub/grub.cfg