<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>04-包命令 on 编程那些事儿</title><link>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/</link><description>Recent content in 04-包命令 on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Tue, 11 Aug 2026 23:57:44 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/index.xml" rel="self" type="application/rss+xml"/><item><title>01-cargo init</title><link>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/01-cargo-init/</link><pubDate>Thu, 30 Jul 2026 14:49:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/01-cargo-init/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://doc.rust-lang.org/cargo/"&gt;The Cargo Book&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="cargo-init1"&gt;cargo-init(1)&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://doc.rust-lang.org/cargo/commands/cargo-init.html"&gt;https://doc.rust-lang.org/cargo/commands/cargo-init.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="name"&gt;名称&lt;/h2&gt;
&lt;p&gt;cargo-init &amp;mdash; 在已有目录中创建新的 Cargo 包&lt;/p&gt;
&lt;h2 id="synopsis"&gt;大纲&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;cargo init&lt;/code&gt; [&lt;em&gt;options&lt;/em&gt;] [&lt;em&gt;path&lt;/em&gt;]&lt;/p&gt;
&lt;h2 id="description"&gt;描述&lt;/h2&gt;
&lt;p&gt;此命令会在当前目录创建新的 Cargo 清单。给定路径参数可在指定目录中创建。&lt;/p&gt;
&lt;p&gt;若目录中已有典型命名的 Rust 源文件，将使用它们。否则会创建示例
&lt;code&gt;src/main.rs&lt;/code&gt; 文件；若传入 &lt;code&gt;--lib&lt;/code&gt;，则创建 &lt;code&gt;src/lib.rs&lt;/code&gt;。&lt;/p&gt;</description></item><item><title>02-cargo install</title><link>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/02-cargo-install/</link><pubDate>Thu, 30 Jul 2026 14:49:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/02-cargo-install/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://doc.rust-lang.org/cargo/"&gt;The Cargo Book&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="cargo-install1"&gt;cargo-install(1)&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://doc.rust-lang.org/cargo/commands/cargo-install.html"&gt;https://doc.rust-lang.org/cargo/commands/cargo-install.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="name"&gt;名称&lt;/h2&gt;
&lt;p&gt;cargo-install &amp;mdash; 构建并安装 Rust 二进制程序&lt;/p&gt;
&lt;h2 id="synopsis"&gt;大纲&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;cargo install&lt;/code&gt; [&lt;em&gt;options&lt;/em&gt;] &lt;em&gt;crate&lt;/em&gt;[@&lt;em&gt;version&lt;/em&gt;]&amp;hellip;&lt;br&gt;
&lt;code&gt;cargo install&lt;/code&gt; [&lt;em&gt;options&lt;/em&gt;] &lt;code&gt;--path&lt;/code&gt; &lt;em&gt;path&lt;/em&gt;&lt;br&gt;
&lt;code&gt;cargo install&lt;/code&gt; [&lt;em&gt;options&lt;/em&gt;] &lt;code&gt;--git&lt;/code&gt; &lt;em&gt;url&lt;/em&gt; [&lt;em&gt;crate&lt;/em&gt;&amp;hellip;]&lt;br&gt;
&lt;code&gt;cargo install&lt;/code&gt; [&lt;em&gt;options&lt;/em&gt;] &lt;code&gt;--list&lt;/code&gt;&lt;/p&gt;
&lt;h2 id="description"&gt;描述&lt;/h2&gt;
&lt;p&gt;此命令管理 Cargo 本地已安装的二进制 crate 集合。仅含可执行 &lt;code&gt;[[bin]]&lt;/code&gt; 或 &lt;code&gt;[[example]]&lt;/code&gt; 目标的包可以安装，所有可执行文件都安装到安装根的 &lt;code&gt;bin&lt;/code&gt; 文件夹中。默认只安装二进制文件，不安装示例。&lt;/p&gt;</description></item><item><title>03-cargo new</title><link>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/03-cargo-new/</link><pubDate>Thu, 30 Jul 2026 14:49:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/03-cargo-new/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://doc.rust-lang.org/cargo/"&gt;The Cargo Book&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="cargo-new1"&gt;cargo-new(1)&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://doc.rust-lang.org/cargo/commands/cargo-new.html"&gt;https://doc.rust-lang.org/cargo/commands/cargo-new.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="name"&gt;名称&lt;/h2&gt;
&lt;p&gt;cargo-new &amp;mdash; 创建新的 Cargo 包&lt;/p&gt;
&lt;h2 id="synopsis"&gt;大纲&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;cargo new&lt;/code&gt; [&lt;em&gt;options&lt;/em&gt;] &lt;em&gt;path&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="description"&gt;描述&lt;/h2&gt;
&lt;p&gt;此命令会在给定目录中创建新的 Cargo 包。包括带有 &lt;code&gt;Cargo.toml&lt;/code&gt; 清单的简单模板、
示例源文件，以及 VCS 忽略文件。若该目录尚不在 VCS 仓库中，
则会创建新仓库（见下方 &lt;code&gt;--vcs&lt;/code&gt;）。&lt;/p&gt;</description></item><item><title>04-cargo search</title><link>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/04-cargo-search/</link><pubDate>Thu, 30 Jul 2026 14:49:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/04-cargo-search/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://doc.rust-lang.org/cargo/"&gt;The Cargo Book&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="cargo-search1"&gt;cargo-search(1)&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://doc.rust-lang.org/cargo/commands/cargo-search.html"&gt;https://doc.rust-lang.org/cargo/commands/cargo-search.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="name"&gt;名称&lt;/h2&gt;
&lt;p&gt;cargo-search &amp;mdash; 在注册表中搜索包。默认注册表为 crates.io&lt;/p&gt;
&lt;h2 id="synopsis"&gt;大纲&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;cargo search&lt;/code&gt; [&lt;em&gt;options&lt;/em&gt;] [&lt;em&gt;query&lt;/em&gt;&amp;hellip;]&lt;/p&gt;
&lt;h2 id="description"&gt;描述&lt;/h2&gt;
&lt;p&gt;在 &lt;a href="https://crates.io"&gt;https://crates.io&lt;/a&gt; 上对 crate 执行文本搜索。匹配的
crate 会与其描述一起以适合复制到 &lt;code&gt;Cargo.toml&lt;/code&gt; 清单中的 TOML 格式显示。&lt;/p&gt;</description></item><item><title>05-cargo uninstall</title><link>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/05-cargo-uninstall/</link><pubDate>Thu, 30 Jul 2026 14:49:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/cargo/cargo-commands/package-commands/05-cargo-uninstall/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://doc.rust-lang.org/cargo/"&gt;The Cargo Book&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="cargo-uninstall1"&gt;cargo-uninstall(1)&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://doc.rust-lang.org/cargo/commands/cargo-uninstall.html"&gt;https://doc.rust-lang.org/cargo/commands/cargo-uninstall.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="name"&gt;名称&lt;/h2&gt;
&lt;p&gt;cargo-uninstall &amp;mdash; 移除 Rust 二进制文件&lt;/p&gt;
&lt;h2 id="synopsis"&gt;大纲&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;cargo uninstall&lt;/code&gt; [&lt;em&gt;options&lt;/em&gt;] [&lt;em&gt;spec&lt;/em&gt;&amp;hellip;]&lt;/p&gt;
&lt;h2 id="description"&gt;描述&lt;/h2&gt;
&lt;p&gt;此命令移除用 &lt;a href="../02-cargo-install/"&gt;cargo-install(1)&lt;/a&gt; 安装的包。&lt;em&gt;spec&lt;/em&gt;
参数是要移除的包的包 ID 规范（见
&lt;a href="../../manifest-commands/06-cargo-pkgid/"&gt;cargo-pkgid(1)&lt;/a&gt;）。&lt;/p&gt;
&lt;p&gt;默认会移除某个 crate 的所有二进制文件，但可用 &lt;code&gt;--bin&lt;/code&gt; 与
&lt;code&gt;--example&lt;/code&gt; 标志仅移除特定二进制文件。&lt;/p&gt;</description></item></channel></rss>