As Lesiak said, you need to remove the space in your string, leaving you with export PATH="$PATH:/Users/user/Desktop/flutter/bin"
. However, this will only change the current shell (terminal) you have open.
To make this permanent, you need to change your zsh configuration file. This is located at $HOME/.zshrc
. Run this command:
$ echo 'export PATH="$PATH:/$HOME/Desktop/flutter/bin"' >> $HOME/.zshrc
This appends export PATH="$PATH:/$HOME/Desktop/flutter/bin"
to the end your .zshrc
file. Note that it is crucial that you use >>
and not >
. >>
appends to the file, >
overwrites it.
To further explain what's going on here:
$HOME
refers to your home directory. On your machine, and if your user is called user
, this would be /Users/user
. This would vary based on the type of operating system you have and your username, therefore we use $HOME
to be device-independent.
$PATH
is where your shell looks for programs to execute when you type a command in the shell. If you do echo $PATH
you can see its content. It could look something like this: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
. All the parts separated by :
is a segment of the path, and your shell looks in each of those directories for a program that matches the command you gave.
PATH
is colon-separated, not colon+space-separated. β Pistareen