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:
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/zshSome 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.
On Internet Relay Chat (IRC), the real name field is sometimes referred to as the gecos field. IRC clients are able to supply this field when connecting. HexChat, an X-Chat fork, defaults to 'realname', TalkSoup.app on GNUstep defaults to 'David Okeamah', and irssi reads the operating system user's full name, replacing it with 'unknown' if not defined. Some IRC clients use this field for advertising; for example, ZNC defaulted to "Got ZNC?" but changed it to "RealName = " to match its configuration syntax in 2015. [4]