I know this is maybe a silly question but I am trying to export my terraform path into my linux path.
My terraform executable sits in a terraform folder under /usr/local/terraform.
I therefore did export PATH=$PATH:/usr/local/terraform/terraform
However, When i try and do terraform (going straight into terminal and type in terraform)it doesnt run. Only when I cd to usr/local/terraform and do a ./terraform then the executable runs.
What am i doing wrong?
Download the installation fileNavigate to the Terraform download page (https://www.terraform.io/downloads.html). It should list out Terraform downloads for various platforms. Navigate to the Windows section and download the respective version. For this example I am downloading V1.
Homebrew is a free and open-source package management system for Mac OS X. Install the official Terraform formula from the terminal. First, install the HashiCorp tap, a repository of all our Homebrew packages. Now, install Terraform with hashicorp/tap/terraform .
Install Terraform Extract the package to the folder C:\Program Files (x86) . This path is used as an example. However, you can also the Terraform executable to any other location in your local system. Update the path environment variable to include the folder where your Terraform executable is located.
Just copy your terraform binary and place it in /usr/local/bin/
sudo mv terraform /usr/local/bin
You can now access terraform from your terminal from anywhere.
Your PATH
should list the directory the executable is in, not the executable itself:
export PATH=$PATH:/usr/local/terraform/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With