Thums Asked: 2014-10-22 12:07:06 +0800 CST2014-10-22 12:07:06 +0800 CST 2014-10-22 12:07:06 +0800 CST Where, in Ubuntu's files, is stored the full name of a user? 772 Usually the users have a full name associated to them, where is that stored? username 3 Answers Voted Florian Diesch 2014-10-22T12:09:04+08:002014-10-22T12:09:04+08:00 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). sboda 2014-10-22T12:14:49+08:002014-10-22T12:14:49+08:00 Or if you would like to see the full name of only one user, than you could use: getent passwd $user_name MestreLion 2021-04-21T05:07:03+08:002021-04-21T05:07:03+08:00 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
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).Or if you would like to see the full name of only one user, than you could use:
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.
Testing: