Linux Indepth #4
Issue: You want to list users’ UIDs and GIDs. Solution Use the id command with no options to see your own UID and GIDs. In the following example, the user is Duchess: duchess@pc:~$ id Display another user’s UID and GIDs by providing their username as an argument: duchess@pc:~$ id kishore Display your effective ID. This is your ID when you run a command as another user. You can see this with sudo : duchess@client4:~$ sudo id -un root duchess@client4:~$ sudo -u kishore id -gn kishore ---------------------------------------------------------------------------------------------------------------------------- Issue: You want to create a new user with a user private group and home directory populated with a set of default files like .bashrc , .profile , .bash_history , and any other files you want them to have. Solution The useradd command is included in most Linux distributions and is configurable to suit your re...