Something is going really wrong with my cmd. I am trying to run a simple 'ls' command and it is impossible. The error says
Command 'ls' is available in '/bin/ls The command could not be located because '/bin' is not included in the PATH environment variable.'
I tried to find similar question but I didn't managed to fix the problem, and I am afraid that I will make it worse. When I run
echo $PATH
I am getting this
bash: SPATH:/home/george/snap/flutter/common/flutter/bin:/opt/netbeans/bin: No such file or directory
I think I messed it up with flutter and netbeans but I am not sure how to fix it. Thank you for your time.
Your PATH environmental variable does not anymore include standard system locations for binaries.
ls
, which is an executable in/usr/bin/
, is not found.echo
is a shell build-in and thus can be executed.Your error is caused by a typo. You indicated
SPATH
rather than$PATH
in your new PATH statement. The first is just that, the second will be substituted automatically by the current setting of the PATH.So wherever you changed your PATH, correct this typo. Chances are you have done the changes in
~/.profile
or eventually~/.bashrc
, unless you have modified system files. See here for places where a PATH is set or changed in a Linux system.There's probably a typo in your integration of Flutter and NetBeans. If you reference a environment variable, you prefix it with a dollar sign, for example
$PATH
.To add something to your existing path, you set the variable to the old value, plus your additions:
Going by your question, your integration of Flutter and NetBeans doesn't refer to
$PATH
, but toSPATH
. So, you're setting the path to the newly added directories, but without keeping the previous path.