On 19/12/2021 11:01, Morteza Ghorbani wrote:
Hello I am Morteza Ghorbani While Working with id utility, I found strange behavior. Suppose that my username is ‘user1’ , so if I remove user1 from a particular group (e.g. netdev) by the following instruction : gpasswd –delete user1 netdev then if I enter the ‘id’ command, I will be noted that nothing has been changed and still see the group which I removed the use1 from.
You have to log out/in to do the change. Then it will show the change in 'id'.
On the other hand, if I enter the command ‘ id user1 ‘, by this way I can see the changes !
That looks up the latest definition of 'user1'
In a nutshell, ‘id’ --> does not show the changes while ‘id user1’ shows the changes and its behavior is correct.
-- Chris Elvidge