UEFI Command Operations
4.1.2 UEFI shell command syntax
You can view and display the shell environment variables by using the set command.
To access an environment variable value as an argument for a shell command, enclose the variable name in
percent signs “%”, as shown below.
%myvariable%
The shell has a special variable called lasterror. This variable retains the value returned by the last executed
shell command.
The file name argument in shell commands uses the following characters as wildcards: “*”, “?”, “[“, and “]”.

TABLE 4.1 Wildcard characters in the UEFI shell

Character string
Meaning

*

Matches 0 or more characters in the file name.

?

Matches exactly 1 character in the file name.
[Character string]
Matches any of the characters between the brackets [ ]. An example is [azA-Z].
4.1.3 Output redirection
UEFI shell command output can be redirected to a file. The syntax to do so is as follows.
Command > unicode_output_file_pathname
Command >a ascii_output_file_pathname
Command 1> unicode_output_file_pathname
Command 1>a ascii_output_file_pathname
Command 2> unicode_output_file_pathname
Command 2>a ascii_output_file_pathname
Command >> unicode_output_file_pathname
Command >>a ascii_output_file_pathname
Command 1>> unicode_output_file_pathname
Command 1>>a ascii_output_file_pathname
TABLE 4.2 Output redirection lists the types of output redirection and append.

TABLE 4.2 Output redirection

Character string
Meaning
>
Redirects the standard output to a Unicode file.
>a
Redirects the standard output to an ASCII file.
1>
Redirects the standard output to a Unicode file.
1>a
Redirects the standard output to an ASCII file.
2>
Redirects the standard error output to a Unicode file.
2>a
Redirects the standard error output to an ASCII file.
>>
Appends the standard output to a Unicode file.
>>a
Appends the standard output to an ASCII file.
1>>
Appends the standard output to a Unicode file.