Last modified on 31 August 2009, at 20:26

Guide to Unix/Commands/Self Information

whoamiEdit

whoami tells you your current username.

Examples:

$ whoami
abicool

groupsEdit

groups states the groups the current user is a member of

Examples:

$ groups
wheel slocate www

idEdit

id gives you the same information as the whoami and groups commands, but also includes the user id (uid) and group id (gid) integers associated with the login.

Examples:

$ id
uid=3426(alice) gid=10(wheel)
groups=10(wheel),21(slocate),401(www)

ttyEdit

tty tells you the terminal device that is assigned to your interactive login. The tty represents your console device, network connection ("ssh", ...), or terminal emulator process ("xterm", "konsole", ...).

Examples:

$ tty
/dev/pts/14