Add new value to $PATH variable in Linux (Debian, CentOS, Ubuntu)
With SSH you sometimes need to add new value to the $PATH variable. When your application is not in the directory, which exists in the $PATH array. If you don't want to write down the full path in the command line, for example, '/home/user/myapps/makephoto', you can add '/home/user/myapps/' to $PATH and then you can execute 'makephoto' easier.
Show all the values for $PATH:
echo $PATH
will return
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/root/.dotnet/tools:/root/dotnet/
Add new value:
export PATH=$PATH:/usr/sbin
then the result is new:
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/root/.dotnet/tools:/root/dotnet/:/usr/sbin
To remove the value from $PATH you should write new values instead
export PATH=/usr/local/bin:/usr/bin:/root/.dotnet/tools:/root/dotnet/:/usr/sbin