4
chfn --office-phone ''

and

chfn --home-phone ''

work, yet I see no parameter for --mobile-phone or similar. Is this perhaps a strange configuration of my OS, or is this value set elsewhere? Is there perhaps simply no value for a mobile phone number?

I've looked in /etc/login.defs and man chfn | grep mobile doesn't return anything relevant.

2 Answers 2

3

chfn command is used to edit the GECOS field of /etc/passwd file on linux.

According to the manpage of chfn,

OPTIONS
       The options which apply to the chfn command are:

       -f, --full-name FULL_NAME
           Change the user's full name.

       -h, --home-phone HOME_PHONE
           Change the user's home phone number.

       -o, --other OTHER
           Change the user's other GECOS information. This field is used to store accounting information used by other
           applications, and can be changed only by a superuser.

       -r, --room ROOM_NUMBER
           Change the user's room number.

       -R, --root CHROOT_DIR
           Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
           Only absolute paths are supported.

       -u, --help
           Display help message and exit.

       -w, --work-phone WORK_PHONE
           Change the user's office phone number.

From Wikipedia,

The typical format for the GECOS field is a comma-delimited list 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.)

Therefore, an explicit field for mobile phone does not exist, however, you can use the other field for adding mobile phone numbers by using the -o or --other flag.

4
  • 3
    Thanks. Perhaps it predates mobile phone numbers. Commented Jul 15 at 15:55
  • 5
    @RokeJulianLockhart The metadata format technically predates UNIX itself. The field originated to store user identity information for the handful of GE/Honeywell mainframes (which ran GECOS as their OS) that were being used as print-spoolers at Bell Labs at the time UNIX was being developed. A handful of pre-cellular mobile telephony services (sometimes called ‘0G’) did actually exist at the time, but they were largely specialized systems used for things like car phones, not something you would care about for contact with an employee (and GECOS was very much a business OS). Commented Jul 16 at 2:09
  • @AustinHemmelgarn: Does the format come from GCOS, or does the field come from GCOS? My understanding was that it had originally been used to store a GCOS account number but later repurposed for other information once nobody was running GCOS anymore, i.e. the format that chfn uses was not the original format GCOS used? Commented Jul 16 at 11:26
  • @grawity_u1686 My understanding has always been that the information stored there now comes from what GCOS stored as contact information about the user, albeit probably in a different format. IOW, once GCOS was not being used, they repurposed the field to provide the same info they would have been fetching from GCOS. I may be completely wrong about that though. Commented Jul 16 at 11:34
5

Is there perhaps simply no value for a mobile phone number?

That is the primary reason – these subfields exist mostly for the sake of the finger command from the 1970s-1980s, which one might run on the company's or university's shared Unix system (at a time when computers were still counted in single digits per company) to see who else was currently logged in. Hence the 'room number' field (as in office number).

If I have my timeline right, mobile phones were still a rarity at the time such systems were in use, and by the time enough people had mobile phones worth including in their Unix user account's profile, nobody was looking at anyone else's Unix account's profile anymore.

However, at the same time, finger on Unix has always had the ability to show any kind of custom information through the ~/.plan file. Any text you put in your ~/.plan would be shown to others as part of the "profile" – and with that ability, it wasn't really necessary to keep extending the user database with more and more information that only served a single purpose anyway.

athena% finger
Login    Name                Tty      Idle  Login Time   Office     Office Phone
amb      Andrew X. Xxxxxxx   pts/210    5d  Jan 14 00:26 (pool-xxx.verizon.net)
barrys   Barry M Stxxxxx     pts/217    1d  Jan 25 14:42 (sandwiches.mit.edu)
dkb      Dxxxxx Bxxx         pts/1    4:43  Jan 26 08:07 (xxxx.east.verizon.net)
ethanis  Ethan P Sxxxxxxx    pts/205   13d  Jan 14 15:02 (mosh [12096])
gry      George Rxxxxx Yxxxx pts/6    9:31  Jan 25 21:07 (2##.4#.##.###)

athena% finger gry
Login: gry                        Name: George Rxxxxxx Yxxxx
Directory: /mit/gry               Shell: /bin/athena/tcsh
Office: LL-L-319, 781-9##-2###
On since Fri Jan 25 21:07 (EST) on pts/6 from 2##.4#.##.###
   9 hours 31 minutes idle
No mail.
No Plan.

(This "screenshot" from 2013 was obtained over the network from @athena.dialup.mit.edu, with MIT being one of the last few places that still used such a system.)

Likewise, there is no "email address" field because at the time such systems were in use, one's username frequently was their email address, with mail handled on the very same system. So if you happened to use finger [email protected] across the network, as was possible once upon a time, it was a pretty good guess that you could also email [email protected].

(You'll notice that Finger even has a line No mail which would have shown whether the person had unread mail as a rough indication of how busy they were. This was done by checking the timestamp of /var/mail/$USER where local mail was commonly delivered.)

1
  • 1
    Thanks. I've left the other answer as it's slightly better as an answer to the specific question I've asked, but this is the much more interesting one - which explains why it's like this. Many thanks. Perhaps it's not worth worrying about these values, then. Commented Jul 15 at 21:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .