PDA

View Full Version : Command to display groups and user



cola
4th March 2009, 02:59 PM
Hi,
Is there any command to display the groups and user ?
And how many users are there?
And how to delete a group?

PabloTwo
4th March 2009, 03:33 PM
Is there any command to display the groups and user ?
cat /etc/group

And how many users are there?
users will show currently logged in users. Output from answer 1 should show all configured users.

And how to delete a group?
groupdel nameofgroup

cola
4th March 2009, 03:39 PM
cat /etc/group

users will show currently logged in users. Output from answer 1 should show all configured users.

groupdel nameofgroup

Thanks ,
And why "users" command shows the logged in user-name three times in the terminal?

PabloTwo
4th March 2009, 03:46 PM
Because that's how many tty's the user is logged into at present. Log into a desktop session and that's one tty. Open a log-in terminal in that desktop session and that's two tty's, etc.

cola
4th March 2009, 03:52 PM
Because that's how many tty's the user is logged into at present. Log into a desktop session and that's one tty. Open a log-in terminal in that desktop session and that's two tty's, etc.

Thanks PabloTwo.

PabloTwo
4th March 2009, 04:06 PM
You're welcome cola-

And to help you help yourself at finding and understanding various commands related to users and groups, here are some things you can do.

Take a stab in the dark: man group Success. It tells us there is a file called /etc/group and what's in it.

ls /usr/sbin/*users*
ls /usr/sbin/*group*

Now we see lots of commands dealing with users and groups. Do man commandname to learn about the ones you're interested or curious about.