cargo-clean(1)

NAME

cargo-clean --- Remove generated artifacts

SYNOPSIS

cargo clean [options]

DESCRIPTION

Remove artifacts from the target directory that Cargo has generated in the past.

With no options, cargo clean will delete the entire target directory.

OPTIONS

Package Selection

When no packages are selected, all packages and all dependencies in the workspace are cleaned.

Clean Options

Display Options

Manifest Options

Common Options

ENVIRONMENT

See the reference for details on environment variables that Cargo reads.

EXIT STATUS

  • 0: Cargo succeeded.
  • 101: Cargo failed to complete.

EXAMPLES

  1. Remove the entire target directory:

    cargo clean
    
  2. Remove only the release artifacts:

    cargo clean --release
    

SEE ALSO

cargo(1), cargo-build(1)