← 返回命令列表

Linux command

cargo-version 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show Cargo version

cargo version

Show verbose version info

cargo version --verbose

Short form

cargo -V

Verbose short form

cargo -Vv

说明

cargo version displays the version of Cargo along with build metadata. The default output shows the version number, git commit hash, and build date. With the `--verbose` flag, additional details are shown including the host triple, linked library versions (libgit2, libcurl, SSL), and operating system information. This command is useful for diagnosing build issues, verifying toolchain installations, and including version information in CI/CD logs and bug reports. It operates entirely offline with no side effects.

参数

-v, --verbose
Show additional build metadata
--format-version _n_
Output format: 1 (legacy JSON), 2 (human-readable, default)

FAQ

What is the cargo-version command used for?

cargo version displays the version of Cargo along with build metadata. The default output shows the version number, git commit hash, and build date. With the `--verbose` flag, additional details are shown including the host triple, linked library versions (libgit2, libcurl, SSL), and operating system information. This command is useful for diagnosing build issues, verifying toolchain installations, and including version information in CI/CD logs and bug reports. It operates entirely offline with no side effects.

How do I run a basic cargo-version example?

Run `cargo version` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -v, --verbose do in cargo-version?

Show additional build metadata