跳转到主要内容

standard-specifiers

%a

Architecture

A short string identifying the architecture of the local system. A string such as

x86

,

x86-64

or

arm64

. See the architectures defined for

ConditionArchitecture=

in

systemd.unit

5

for a full list.

%A

Operating system image version

The operating system image version identifier of the running system, as read from the

IMAGE_VERSION=

field of

/etc/os-release

. If not set, resolves to an empty string. See

os-release

5

for more information.

%b

Boot ID

The boot ID of the running system, formatted as string. See

random

4

for more information.

%B

Operating system build ID

The operating system build identifier of the running system, as read from the

BUILD_ID=

field of

/etc/os-release

. If not set, resolves to an empty string. See

os-release

5

for more information.

%D

Shared data directory

This is either

/usr/share/

(for the system manager) or the path

$XDG_DATA_HOME

resolves to (for user managers).

%H

Host name

The hostname of the running system.

%l

Short host name

The hostname of the running system, truncated at the first dot to remove any domain component.

%m

Machine ID

The machine ID of the running system, formatted as string. See

machine-id

5

for more information.

%M

Operating system image identifier

The operating system image identifier of the running system, as read from the

IMAGE_ID=

field of

/etc/os-release

. If not set, resolves to an empty string. See

os-release

5

for more information.

%o

Operating system ID

The operating system identifier of the running system, as read from the

ID=

field of

/etc/os-release

. See

os-release

5

for more information.

%q

Pretty host name

The pretty hostname of the running system, as read from the

PRETTY_HOSTNAME=

field of

/etc/machine-info

. If not set, resolves to the short hostname. See

machine-info

5

for more information.

%T

Directory for temporary files

This is either

/tmp

or the path

$TMPDIR

,

$TEMP

or

$TMP

are set to. (Note that the directory may be specified without a trailing slash.)

%v

Kernel release

Identical to

uname -r

output.

%V

Directory for larger and persistent temporary files

This is either

/var/tmp

or the path

$TMPDIR

,

$TEMP

or

$TMP

are set to. (Note that the directory may be specified without a trailing slash.)

%w

Operating system version ID

The operating system version identifier of the running system, as read from the

VERSION_ID=

field of

/etc/os-release

. If not set, resolves to an empty string. See

os-release

5

for more information.

%W

Operating system variant ID

The operating system variant identifier of the running system, as read from the

VARIANT_ID=

field of

/etc/os-release

. If not set, resolves to an empty string. See

os-release

5

for more information.

%%

Single percent sign

Use

%%

in place of

%

to specify a single percent sign.