How do I see the value and set the value of $CARGO_TARGET_DIR?

Google did not reveal how to see the value of the cargo env variable $CARGO_TARGET_DIR cargo env variable or how to set it.

Ubuntu 18.04

# setting it
$ export CARGO_TARGET_DIR=/some/path

# reading it
$ echo $CARGO_TARGET_DIR

@steveklabnik For some reason, I expected the CARGO_TARGET_DIR var to be inside the cargo environment from within cargo, not as a regular env var set in a .bashrc file. Thanks for your response!

1 Like