Gecos field
From Wikipedia, the free encyclopedia
The gecos field, or GECOS field, is a component of each user record in the /etc/passwd file on Unix and Unix-like operating systems. It is the fifth of the seven colon-separated fields in each line of the file.
Originally derived from the General Electric Comprehensive Operating System (GECOS), this field is commonly used to store general information about the user, such as their full name, office number, phone number, or other contact details. While traditionally limited in length and format, modern systems often use it more flexibly, and some fields within GECOS (like room number or phone) may be left blank or omitted.
The typical format for the GECOS field is a comma-delimited list[1][2] with this order:
- User's full name (or application name, if the account is for a program)
- Building and room number or contact person
- Office telephone number
- Home telephone number
- Any other contact information (pager number, fax, external e-mail address, etc.)
In most UNIX systems non-root users can change their own information using the chfn or chsh command.
Here is an example of GECOS field within an /etc/passwd file in Linux:
janedoe:x:1000:1000:Jane Doe,Room 1015,(234)555-1410,(234)555-1411:/home/janedoe:/usr/bin/zsh
History
Some early Unix systems at Bell Labs used GECOS machines for print spooling and various other services,[3] so this field was added to carry information on a user's GECOS identity.