Use the chfn Command to Update User’s Info In Ubuntu with Examples

This brief tutorial shows students and new users how to use the chfn command in Ubuntu to change or update users “finger” information…

Fingers information is stored in the file /etc/passwd, and includes the user’s real name, both work and home phone numbers, work room and others….

If you’re a student or new user looking for a Linux system to start learning on, the easiest place to start is Ubuntu Linux OS…. It’s a great Linux operating system for beginners and folks looking for easier Linux distribution to use..

Ubuntu is an open source Linux operating systems that runs on desktops, laptops, server and other devices…

When using Ubuntu, you will find that Linux isn’t so different than Windows and other operating systems in so many ways, especially when it comes to using the system to get work done.…

Both Ubuntu and Windows systems allow you to be productive, easy to use, reliable and enable you to install and run thousands of programs from gaming to productivity suite software for individuals and businesses..

However, when you’re learning to use and understand Ubuntu Linux, you should also learn how to use the command line to terminal.. Most Linux users should be able to do some basic command line tasks..

This tutorial is going to show you how…..

When you’re ready to learn how to use the chfn commands, follow the guide below:

About chfn command:

The chfn command is a command line utility that is used to update or modify user’s “finger” information on the system… This info is stored in the /etc/passwd file and including user’s real name, work room, work and home phone numbers, and others..

Syntax:

Syntax is the rule and format of how the chfn command can be used… These syntax options can be reordered, but a straight format must be followed.,.

Below is an example syntax of how to use the chfn command….

chfn [options] [LOGIN]

Options:

The command line options are switches or flags that determined how the commands are executed or controlled… they modify the behavior of the commands… they are separated by spaces and followed after the commands…

Below are some options of the chfn command:

 

  LOGIN Replace LOGIN with the account login name you want to update or modify
    -fIf you use the -f or –full-name option to specify the full name of the user
     -hUse the -h or –home-phone to specify the home phone of the user
     -rUse the -r or –room to specify the user’s room number
      -RThe -R or –root option to specify the user’s directory to chroot into
–helpDisplay a help message and exit.

 

Examples:

Below are some examples of how to run and use the chfn on Ubuntu Linux…

Simply run the chfn to invoke it…

When you run the chfn command it should prompt for your password and allow you to update your finger info..

Changing the user information for jdoe
Enter the new value, or press ENTER for the default
Full Name: John Doe
Room Number [301]:
Work Phone [87738484733]:
Home Phone [7390-2938239]:

To gather info of a particular user, simply run the finger command followed by the user account name..

Example:

finger jdoe

It should display the user richard account info:

Login: jdoe Name: John Doe
Directory: /home/jdoe Shell: /bin/bash
Office: 301, +8-773-848-4733 Home Phone: 7390-2938239
On since Mon Nov 4 14:27 (CST) on :0 from :0 (messages off)
No mail.
No Plan.

If you want to use the chfn command to change a user  full name or Real Name for user jdoe simply run the command with the option below:

Example:

chfn -f "John Doe" jdoe

The command above modifies the user account jdoe with its real name, John Doe

To change the user home and work phone number, simply run the chfn command with the -h and -w option:

Example:

chfn -h 1112225555 -w 1113334444 jdoe

To change the user’s room number, simply run the chfn command with the -r option.

Example:

chfn -r 500 jdoe

Finally, run the finger command to display the user’s updated info:

Login: jdoe Name: John Doe
Directory: /home/jdoe Shell: /bin/bash
Office: 500, 111-333-4444 Home Phone: 111-222-5555
On since Mon Nov 4 14:27 (CST) on :0 from :0 (messages off)
No mail.
No Plan.

That’s it!

Congratulations! You have learned how to use the chfn command on Ubuntu Linux

You may also like the post below:

Setup ILIAS E-Learning LMS On Ubuntu 18.04 | 16.04 With Nginx

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.