0

I am simply trying to install swift on linux

I have downloaded the files from swift.org, extracted .tar files and used export command to include the path after that when I use swift --version it correctly shows the version 5.3.3 but when I close the terminal and try to open the swift command terminal it says command not found.

What is happening here? I need to include the path every time I open the terminal.

  • Does this answer your question? [How to permanently set $PATH on Linux/Unix?](https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix) – wxz Mar 10 '21 at 00:18

1 Answers1

0

The export command just adds the value to path for the current session. When you log out and in again, it will reset.

You need to add this to your shell resource file so that it gets added to the path every time you log in. The file you need to edit will be called .zshrc or .bash_profile or something similar. You should start by opening the command line on your computer and verifying what shell you are running by typing:

echo $SHELL

This will return something like /bin/ksh or /bin/bash or similar. Then do a little internet searching to find out what the resource file is called for that shell. Then edit your resource file to add the Swift path to your $PATH.

Walter
  • 5,867
  • 2
  • 30
  • 43