how to install terraform on linux

I'm trying to install terraform on linux but getting and error

curl -o https://releases.hashicorp.com/terraform/0.11.2/terraform_0.11.2_linux_amd64.zip

its giving error as

curl: no URL specified!

can some one help me on this, thanks in advance


Solution 1:

thanks i'm able to download by using --remote-name before URL

curl -o --remote-name https://releases.hashicorp.com/terraform/0.11.2/terraform_0.11.2_linux_amd64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.5M  100 14.5M    0     0  37.1M      0 --:--:-- --:--:-- --:--:-- 37.2M

Solution 2:

Actually, with the -O or--remote-name flag, curl writes output to a local file named like the remote file we get. So, with this command you can do it:

curl -O -L ttps://releases.hashicorp.com/terraform/0.11.2/terraform_0.11.2_linux_amd64.zip

Here is the portion of the manual pages of curl that describes the -O/--remote-name and --remote-name-all flags:

-O/--remote-name

Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.)

The remote file name to use for saving is extracted from the given URL, nothing else.

You may use this option as many times as the number of URLs you have.

--remote-name-all

This option changes the default action for all given URLs to be dealt with as if -O/--remote-name were used for each one. So if you want to disable that for a specific URL after --remote-name-all has been used, you must use "-o -" or --no-remote-name. (Added in 7.19.0)