I am working on a CentOS release 6.9 linux distribution where my username is a member of two different groups:
mygroup2. If I am currently logged into an interactive shell using my primary group (
mygroup1) and try to switch into my secondary group (
mygroup2) using the command
newgrp - mygroup2, my group does change, but the behavior of the change directory (
cd ~) command does not bring me back to the mygroup2 home directory. Any idea why?
ssh email@example.com id -ng # returns: mygroup1 cd ~ # returns: /home/mygroup1/user newgrp - mygroup2 id -ng # returns: mygroup2 cd ~ # returns: /home/mygroup1/user (same as above, not mygroup2)