Caution Required curl | bash:
Many online sources – even trustworthy and popular ones – recommend a command-line install process that looks like this:
curl $SOMEURL | bash
This uses the curl
command to download content from the web, and then uses that content as the input (|
, the pipe character, which we’ll cover in the “Pipes” chapter) for running bash. When you do this, you’re essentially running a script stored on the Web instead of as a local file. This can be an extremely convenient way of installing software, but please be absolutely sure that it’s coming from a trustworthy source.
We recommend always at least looking at the script source, which you can see in the browser by visiting $SOMEURL from this command, or by splitting this into two commands.
To split something like this into two commands, one to download the installer script and the second to run it:
# Download the installer and name the resulting file installer.sh
curl...