5

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

1

3 Answers 3

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
  • 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, 2014 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
1
  • Downvoter is welcome to explain what is wrong or what could be improved in my answer...
    – MestreLion
    Apr 20, 2021 at 14:42
0

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

getent passwd $user_name

You must log in to answer this question.

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