![Forrest logo](/images/logo.png)
grub-reboot:tldr:1b2ad
The sudo grub-reboot
command is used to set the default boot option for the next system startup. It allows you to choose a different operating system or kernel version to boot into, rather than the default option set in the GRUB bootloader menu.
Here is a breakdown of the command syntax:
-
sudo
: This is a command used in Unix-like operating systems to execute a command with superuser (root) privileges. It allows you to run the following command as an administrator. -
grub-reboot
: This is the command that specifies you want to set the default boot option for the next system startup. It's a part of the GRUB bootloader utility. -
--boot-directory ${-path-to-boot_directory}
: This option specifies the path to the directory where the GRUB bootloader files are stored on your system. You need to replace${-path-to-boot_directory}
with the actual path to your boot directory. For example, it could be/boot/
or/boot/grub/
. -
${entry_number}
: This is the parameter that specifies the entry number of the boot option you want to set as the default. The number is typically based on the order of the boot options listed in the GRUB menu, starting from 0 for the first option.
By combining these elements, the command allows you to change the default boot option for your system without manually selecting it from the GRUB menu when your system starts up.