5

Usually the users have a full name associated to them, where is that stored?

Thums
  • 151

3 Answers3

5

The full names are stored in /etc/passwd.

On the command line you can change it using the command chfn (needs sudo if you want to change other user's names).

  • 1
    Thank you, that's what I needed. The thing is, I'm using deepin, and when entering chfn on the terminal it does not allow me to change the full name. It shows the "full name field", which is empty, but does not require me to insert a new one, goes directly to Room Number. Maybe it is disabled in deepin? – Thums Oct 21 '14 at 20:14
1

An extension of sboda's answer, extracting only the full name and encapsulating a function. Shows the full name of any user, or by default the current user.

full_user_name() { getent passwd "${1:-$USER}" | cut -d: -f5 | cut -d, -f1; }

Testing:

$ full_user_name
Rodrigo Silva

$ full_user_name gdm Gnome Display Manager

MestreLion
  • 20,086
0

Or if you would like to see the full name of only one user, than you could use:

getent passwd $user_name
sboda
  • 512