Getting information about your userid with id

Occasionally, you may need to find out information about your userid, such as what your userid's numeric value is and what groups you belong to. This information is essential when you're sharing files (as discussed in Chapter 5) because you'll need it to let people access your files and to access theirs. You can easily get information about your userid with id, as shown in Code Listing 7.13.

To check userid information using id:

  • id

    At the shell prompt, type id to find out what the numeric value of your userid is and what groups (by name and numeric userid value) you belong to (see Code Listing 7.13). See Chapter 5, page 85, for more about the /etc/group file.

Tip

You can also check someone else's status with id to find out what groups they're in. Just use id userid (substituting the other person's userid for userid, of course).


Code Listing 7.13. Use id to get information about userids and group memberships.
[ejr@hobbes ejr]$ id
uid=500(ejr) gid=500(ejr)
   groups=500(ejr),10(wheel),100(users)
[ejr@hobbes ejr]$ id deb
uid=505(deb) gid=505(deb) groups=100(users)
[ejr@hobbes ejr]$

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.100.42