; Do nothing, successfully • trust:  Add public key to list of trusted keys • unset:  Unset an environment variable • uppermem:  Set the upper memory size • verify_detached:  Verify detached digital signature • videoinfo:  List available video modes

Next: , Up: Command-line and menu entry commands   [Contents][Index]

16.3.1 [

Command: [ expression ]

Alias for test expression (see test).


Next: , Previous: [, Up: Command-line and menu entry commands   [Contents][Index]

16.3.2 acpi

Command: acpi [-1|-2] [--exclude=table1,…|--load-only=table1,…] [--oemid=id] [--oemtable=table] [--oemtablerev=rev] [--oemtablecreator=creator] [--oemtablecreatorrev=rev] [--no-ebda] filename …

Modern BIOS systems normally implement the Advanced Configuration and Power Interface (ACPI), and define various tables that describe the interface between an ACPI-compliant operating system and the firmware. In some cases, the tables provided by default only work well with certain operating systems, and it may be necessary to replace some of them.

Normally, this command will replace the Root System Description Pointer (RSDP) in the Extended BIOS Data Area to point to the new tables. If the --no-ebda option is used, the new tables will be known only to GRUB, but may be used by GRUB’s EFI emulation.


Next: , Previous: acpi, Up: Command-line and menu entry commands   [Contents][Index]

16.3.3 authenticate

Command: authenticate [userlist]

Check whether user is in userlist or listed in the value of variable ‘superusers’. See see superusers for valid user list format. If ‘superusers’ is empty, this command returns true. See Security.


Next: , Previous: authenticate, Up: Command-line and menu entry commands   [Contents][Index]

16.3.4 background_color

Command: background_color color

Set background color for active terminal. For valid color specifications see see Colors. Background color can be changed only when using ‘gfxterm’ for terminal output.

This command sets color of empty areas without text. Text background color is controlled by environment variables color_normal, color_highlight, menu_color_normal, menu_color_highlight. See Special environment variables.


Next: , Previous: background_color, Up: Command-line and menu entry commands   [Contents][Index]

16.3.5 background_image

Command: background_image [[--modestretch’|‘normal’] file]

Load background image for active terminal from file. Image is stretched to fill up entire screen unless option --modenormal’ is given. Without arguments remove currently loaded background image. Background image can be changed only when using ‘gfxterm’ for terminal output.


Next: , Previous: background_image, Up: Command-line and menu entry commands   [Contents][Index]

16.3.6 badram

Command: badram addr,mask[,addr,mask...]

Filter out bad RAM.

This command notifies the memory manager that specified regions of RAM ought to be filtered out (usually, because they’re damaged). This remains in effect after a payload kernel has been loaded by GRUB, as long as the loaded kernel obtains its memory map from GRUB. Kernels that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot kernels in general.

Syntax is the same as provided by the Memtest86+ utility: a list of address/mask pairs. Given a page-aligned address and a base address / mask pair, if all the bits of the page-aligned address that are enabled by the mask match with the base address, it means this page is to be filtered. This syntax makes it easy to represent patterns that are often result of memory damage, due to physical distribution of memory cells.


Next: , Previous: badram, Up: Command-line and menu entry commands   [Contents][Index]

16.3.7 blocklist

Command: blocklist file

Print a block list (see Block list syntax) for file.


Next: , Previous: blocklist, Up: Command-line and menu entry commands   [Contents][Index]

16.3.8 boot

Command: boot

Boot the OS or chain-loader which has been loaded. Only necessary if running the fully interactive command-line (it is implicit at the end of a menu entry).


Next: , Previous: boot, Up: Command-line and menu entry commands   [Contents][Index]

16.3.9 cat

Command: cat [--dos] file

Display the contents of the file file. This command may be useful to remind you of your OS’s root partition:

grub> cat /etc/fstab

If the --dos option is used, then carriage return / new line pairs will be displayed as a simple new line. Otherwise, the carriage return will be displayed as a control character (‘<d>’) to make it easier to see when boot problems are caused by a file formatted using DOS-style line endings.


Next: , Previous: cat, Up: Command-line and menu entry commands   [Contents][Index]

16.3.10 chainloader

Command: chainloader [--force] file

Load file as a chain-loader. Like any other file loaded by the filesystem code, it can use the blocklist notation (see Block list syntax) to grab the first sector of the current partition with ‘+1’. If you specify the option --force, then load file forcibly, whether it has a correct signature or not. This is required when you want to load a defective boot loader, such as SCO UnixWare 7.1.


Next: , Previous: chainloader, Up: Command-line and menu entry commands   [Contents][Index]

16.3.11 clear

Command: clear

Clear the screen.


Next: , Previous: clear, Up: Command-line and menu entry commands   [Contents][Index]

16.3.12 cmosclean

Command: cmosclean byte:bit

Clear value of bit in CMOS at location byte:bit. This command is available only on platforms that support CMOS.


Next: , Previous: cmosclean, Up: Command-line and menu entry commands   [Contents][Index]

16.3.13 cmosdump

Dump: CMOS contents

Dump full CMOS contents as hexadecimal values. This command is available only on platforms that support CMOS.


Next: , Previous: cmosdump, Up: Command-line and menu entry commands   [Contents][Index]

16.3.14 cmostest

Command: cmostest byte:bit

Test value of bit in CMOS at location byte:bit. Exit status is zero if bit is set, non zero otherwise. This command is available only on platforms that support CMOS.


Next: , Previous: cmostest, Up: Command-line and menu entry commands   [Contents][Index]

16.3.15 cmp

Command: cmp file1 file2

Compare the file file1 with the file file2. If they differ in size, print the sizes like this:

Differ in size: 0x1234 [foo], 0x4321 [bar]

If the sizes are equal but the bytes at an offset differ, then print the bytes like this:

Differ at the offset 777: 0xbe [foo], 0xef [bar]

If they are completely identical, nothing will be printed.


Next: , Previous: cmp, Up: Command-line and menu entry commands   [Contents][Index]

16.3.16 configfile

Command: configfile file

Load file as a configuration file. If file defines any menu entries, then show a menu containing them immediately. Any environment variable changes made by the commands in file will not be preserved after configfile returns.


Next: , Previous: configfile, Up: Command-line and menu entry commands   [Contents][Index]

16.3.17 cpuid

Command: cpuid [-l]

Check for CPU features. This command is only available on x86 systems.

With the -l option, return true if the CPU supports long mode (64-bit).

If invoked without options, this command currently behaves as if it had been invoked with -l. This may change in the future.


Next: , Previous: cpuid, Up: Command-line and menu entry commands   [Contents][Index]

16.3.18 crc

Command: crc arg …

Alias for hashsum --hash crc32 arg …. See command hashsum (see hashsum) for full description.


Next: , Previous: crc, Up: Command-line and menu entry commands   [Contents][Index]

16.3.19 cryptomount

Command: cryptomount device|-u uuid|-a|-b

Setup access to encrypted device. If necessary, passphrase is requested interactively. Option device configures specific grub device (see Naming convention); option -u uuid configures device with specified uuid; option -a configures all detected encrypted devices; option -b configures all geli containers that have boot flag set.

GRUB suports devices encrypted using LUKS and geli. Note that necessary modules (luks and geli) have to be loaded manually before this command can be used.


Next: , Previous: cryptomount, Up: Command-line and menu entry commands   [Contents][Index]

16.3.20 date

Command: date [[year-]month-day] [hour:minute[:second]]

With no arguments, print the current date and time.

Otherwise, take the current date and time, change any elements specified as arguments, and set the result as the new date and time. For example, ‘date 01-01’ will set the current month and day to January 1, but leave the year, hour, minute, and second unchanged.


Next: , Previous: date, Up: Command-line and menu entry commands   [Contents][Index]

16.3.21 linux

Command: devicetree file

Load a device tree blob (.dtb) from a filesystem, for later use by a Linux kernel. Does not perform merging with any device tree supplied by firmware, but rather replaces it completely. GNU/Linux.


Next: , Previous: devicetree, Up: Command-line and menu entry commands   [Contents][Index]

16.3.22 distrust

Command: distrust pubkey_id

Remove public key pubkey_id from GRUB’s keyring of trusted keys. pubkey_id is the last four bytes (eight hexadecimal digits) of the GPG v4 key id, which is also the output of list_trusted (see list_trusted). Outside of GRUB, the key id can be obtained using gpg --fingerprint). These keys are used to validate signatures when environment variable check_signatures is set to enforce (see check_signatures), and by some invocations of verify_detached (see verify_detached). See Using digital signatures, for more information.


Next: , Previous: distrust, Up: Command-line and menu entry commands   [Contents][Index]

16.3.23 drivemap

Command: drivemap -l|-r|[-s] from_drive to_drive

Without options, map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. For convenience, any partition suffix on the drive is ignored, so you can safely use ${root} as a drive specification.

With the -s option, perform the reverse mapping as well, swapping the two drives.

With the -l option, list the current mappings.

With the -r option, reset all mappings to the default values.

For example:

drivemap -s (hd0) (hd1)

Next: , Previous: drivemap, Up: Command-line and menu entry commands   [Contents][Index]

16.3.24 echo

Command: echo [-n] [-e] string …

Display the requested text and, unless the -n option is used, a trailing new line. If there is more than one string, they are separated by spaces in the output. As usual in GRUB commands, variables may be substituted using ‘${var}’.

The -e option enables interpretation of backslash escapes. The following sequences are recognised:

\\

backslash

\a

alert (BEL)

\c

suppress trailing new line

\f

form feed

\n

new line

\r

carriage return

\t

horizontal tab

\v

vertical tab

When interpreting backslash escapes, backslash followed by any other character will print that character.


Next: , Previous: echo, Up: Command-line and menu entry commands   [Contents][Index]

16.3.25 eval

Command: eval string ...

Concatenate arguments together using single space as separator and evaluate result as sequence of GRUB commands.


Next: , Previous: eval, Up: Command-line and menu entry commands   [Contents][Index]

16.3.26 export

Command: export envvar

Export the environment variable envvar. Exported variables are visible to subsidiary configuration files loaded using configfile.


Next: , Previous: export, Up: Command-line and menu entry commands   [Contents][Index]

16.3.27 false

Command: false

Do nothing, unsuccessfully. This is mainly useful in control constructs such as if and while (see Shell-like scripting).


Next: , Previous: false, Up: Command-line and menu entry commands   [Contents][Index]

16.3.28 gettext