Grub4dos Guide - Command Line

Please read the previous section first, as this also covers some command line usage. For a full list of commands and usage, see here.

To drop into a command shell press [c] if a boot menu is displayed – this is useful for debugging menu.lst entries. As stated earlier, if the configuration file is not found a command shell is loaded by default.

To view available commands type help --all when in the command shell – this will list all commands (see figure 1. below).

figure 1.

For help with individual commands type help [command] – e.g. help chainloader will display chainloader command usage.

The auto complete feature was discussed briefly in the preceding section. The following examples illustrate its versatility (output is from a test system with two hard disks and one cd attached) -

Entering f [tab] will list all possible completions for commands beginning with the letter "f" -

grub> f
Possible commands are: fallback find foreground fstest

Adding i [tab] will auto complete from grub> fi to the following, as there are no other possible completions for a command beginning with "fi" -

grub> find _

Adding ( [tab] will list all possible devices. E.g. -

grub> find (
Possible disks are: hd0 hd1 rd cd

Adding hd0 [tab] will auto complete to -

grub> find (hd0,_

Pressing [tab] again will display possible partitions, if more than one partition is present. E.g. -

Adding / [tab] will list all files/directories at the root of the device. E.g. -

grub> find (hd0,0)/
Possible files are: io.sys msdos.sys command.com

Expanding on one of the above examples, the [tab] feature provides a quick method of finding which devices are available. Typing a relevant command followed by ( [tab] (e.g. root ( , chainloader ( , etc) will list all possible completions for the devices starting with ( - basically all devices. E.g. -

grub> chainloader (
Possible disks are: hd0 hd1 rd cd

By adding a (unique) tag/marker file to the root of a device it is possible to use the find command to identify the name of the device as allocated via grub4dos. For example, typing find /hdd.tag will search the root of all supported partitions for the file hdd.tag and will return the name of the device containing the file - e.g. (hd0,0). If the file is present on more than one device, then the other devices will also be displayed. As reported earlier, devices are searched in the order (hd), then (cd), then (fd). Using the same method it is possible to use relative paths in menu entries by using the find --set-root command - see here.