Linux distributions stores different information about the user accounts. The
User Full Name is also stored for the users and located inside the
/etc/passwd file. The user’s full name is requested during user account creation. But it can be changed later in different ways. The user’s full name can be changed via a command-line interface or GUI. In this tutorial, we examine command line or GUI methods to change a user’s full name in Linux.
Show User Full Name
The user’s full name is stored inside the /etc/passwd and there are different ways to show the user’s full name. The
cat command can be used to print the passwd file which also shows the user’s full name.
$ cat /etc/passwd
Change User Full Name with chfn Command
The native and easiest way to change user’s full name is the
chfn command. The chfn command
-f option is used to set specified user full name. The username is provided as a parameter to specify the user which full name will be set. In the following example, we set the user ismail name as “İsmail Baydan”.
$ chfn -f "İsmail Baydan" ismail
Change User Full Name with usermod Command
Another command to set or change user full name is the
usermod command. The user full name is provided with the
-c option and also the username is provided. In the following example, we set the user ismail name as “İsmail Baydan”.
$ usermod -c "İsmail Baydan" ismail
Change User Full Name via /etc/passwd File
The user full name is stored inside the /etc/passwd file. This file can be opened with an text editor and related user full name can be changed and saved as the last step. The /etc/passwd file should be opened with the administrator privileges like root or by using the sudo command.
$ sudo nano /etc/passwd
Change User Full Name via GUI (Gnome)
Another way to change user’s full name is using the GUI which can be GNOME, KDE, XFCE, etc. Just open the
Settings tool and navigate to the
Users tab from the left pane. Then click on the pen image which edits the user’s full name.
Just edit the user’s full name and click different locations to save the new full name.