When i run su on command line and enter root password, I am getting error as mentioned below:
Command 'lesspipe' is available in the following places
/bin/lesspipe
/usr/bin/lesspipe
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
I have to manually export PATH variable which earlier used to work by default.
I then set the PATH variable in bashrc
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
Now whenever I run su, I get this :
bash: groups: command not found.
However, I can tab groups command and the PATH variable is also set. Does anyone have any idea where should PATH variable be set so that it is exported for all users?(it was working fine earlier without any errors)