LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Questions if "id" command! (https://www.linuxquestions.org/questions/programming-9/questions-if-id-command-161532/)

yulitao 03-23-2004 05:49 PM

Questions if "id" command!
 
I created a user is john, and his group is business, I found the business group's ID is 500
when I use less /etc/group. but when I use id -g business , it shows "id:business:no such user", and then I run id -u john, it shows 502, why id -g business doesn't work??????????????????????????????

Hko 03-23-2004 06:33 PM

Re: Questions if "id" command!
 
Quote:

Originally posted by yulitao
when I use id -g business , it shows "id:business:no such user", and then I run id -u john, it shows 502, why id -g business doesn't work?
"id" only takes an username as an argument. When you do "id -g business" this will not print the group-ID of the group "business", but it tries to print the (effective) group ID of user "business", which doesn't exist.

Try: id -G john
This will print the groups-ID's user "john" is member of.


All times are GMT -5. The time now is 08:51 PM.