"curl -sSf" means

rust installation command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs

Follow the curl man page:

--fail-with-body

(HTTP) Return an error on server errors where the HTTP response code is 400 or greater). In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This flag will still allow curl to output and save that content but also to return error 22.

This is an alternative option to -f, --fail which makes curl fail for the same circumstances but without saving the content.

See also -f, --fail. Added in 7.76.0.

-f, --fail

(HTTP) Fail silently (no output at all) on server errors. This is mostly done to enable scripts etc to better deal with failed attempts. In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This flag will prevent curl from outputting that and return error 22.

This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407).

See also --fail-with-body.

-S, --show-error

When used with -s, --silent, it makes curl show an error message if it fails.

See also --no-progress-meter.

-s, --silent

Silent or quiet mode. Don't show progress meter or error messages. Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it.

Use -S, --show-error in addition to this option to disable progress meter but still show error messages.

See also -v, --verbose, --stderr and --no-progress-meter.

Does "-sSf" option not show error, fail and process?
Thanks.

The verb "return error" here refers to the code with which curl exits.
This value can be obtained by the shell, for instance, with echo $?.
So -sSf shows no progress, if a server error occurs, it'll exit with 22 (and the shell can check for it if it wants); if other errors occur, they'll be output.
You really only need -s, btw.

1 Like

-f is needed to prevent to execute server error messages as a shell script. -S is needed to
let the user know some error occurred when it happened.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.