Hello new to this need a little help

I know this is going to be something simple but I have installed golang on my linux operating system and i followed all the instructions or so I thought and golang and the associated commands with it are working great so no complaints there. The problem im having is that when I put the terminal to the root profile via the su command ONLY GO COMMANDS WORK. None of the bash commands are recognized nor any other command for that matter ive looked through all my .bashrc files where i added the go environment path/variables and its not showing up in any of the files or anywhere that Ive been able to find. If anyone has the time to lend a hand on this one Id appreciate it. Just to add when the terminal is not on the root profile everything works fine just have to use sudo which is no big deal or anything if this is nothing to worry about Im cool with that as an answer as well.

1 Like

You shall prefer sudo over su…

Aside of that, how have you installed go? Which linux distribution are you using? Do you have the same problem when using sudo? Whats the value of roots PATH? What shell does root use?

2 Likes

Hi Bob,

Norbert is exactly on the right track with his questions. Including that sudo is generally preferred over su unless you have been using Unix systems nearly your whole life. :wink:

Your problem is most likely the result of root’s PATH being set differently than when you are “yourself” (not su’d).

I suggest you su and then run echo $PATH to see what is going on there. Then look in /root/.bash_profile and /root/.bashrc to see how PATH is set.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.