14 GRUB's user interface ************************ GRUB has both a simple menu interface for choosing preset entries from a configuration file, and a highly flexible command-line for performing any desired combination of boot commands. GRUB looks for its configuration file as soon as it is loaded. If one is found, then the full menu interface is activated using whatever entries were found in the file. If you choose the "command-line" menu option, or if the configuration file was not found, then GRUB drops to the command-line interface. 14.1 The flexible command-line interface ======================================== The command-line interface provides a prompt and after it an editable text area much like a command-line in Unix or DOS. Each command is immediately executed after it is entered(1) (*note Command-line interface-Footnote-1::). The commands (*note Command-line and menu entry commands::) are a subset of those available in the configuration file, used with exactly the same syntax. Cursor movement and editing of the text on the line can be done via a subset of the functions available in the Bash shell: Move forward one character. Move back one character. Move to the start of the line. Move the the end of the line. Delete the character underneath the cursor. Delete the character to the left of the cursor. Kill the text from the current cursor position to the end of the line. Kill backward from the cursor to the beginning of the line. Yank the killed text back into the buffer at the cursor. Move up through the history list. Move down through the history list. When typing commands interactively, if the cursor is within or before the first word in the command-line, pressing the key (or ) will display a listing of the available commands, and if the cursor is after the first word, the '' will provide a completion listing of disks, partitions, and file names depending on the context. Note that to obtain a list of drives, one must open a parenthesis, as 'root ('. Note that you cannot use the completion functionality in the TFTP filesystem. This is because TFTP doesn't support file name listing for the security. (1) However, this behavior will be changed in the future version, in a user-invisible way. 14.2 The simple menu interface ============================== The menu interface is quite easy to use. Its commands are both reasonably intuitive and described on screen. Basically, the menu interface provides a list of "boot entries" to the user to choose from. Use the arrow keys to select the entry of choice, then press to run it. An optional timeout is available to boot the default entry (the first one if not set), which is aborted by pressing any key. Commands are available to enter a bare command-line by pressing (which operates exactly like the non-config-file version of GRUB, but allows one to return to the menu if desired by pressing ) or to edit any of the "boot entries" by pressing . If you protect the menu interface with a password (*note Security::), all you can do is choose an entry by pressing , or press

to enter the password. 14.3 Editing a menu entry ========================= The menu entry editor looks much like the main menu interface, but the lines in the menu are individual commands in the selected entry instead of entry names. If an is pressed in the editor, it aborts all the changes made to the configuration entry and returns to the main menu interface. Each line in the menu entry can be edited freely, and you can add new lines by pressing at the end of a line. To boot the edited entry, press . Although GRUB unfortunately does not support "undo", you can do almost the same thing by just returning to the main menu using .