• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

chfn Command Examples in Linux

by Deepika

chfn is a command-line utility in Linux that is used to change the user information associated with a specific user account. This information includes the user’s full name, office location, office phone number, and other details that are stored in the system password file.

To use chfn, you will need to have root privileges or be the owner of the user account that you want to modify. You can then use the following command syntax to change the user information:

# chfn [options] username

This command will prompt you to enter the new user information, which you can enter by typing or pasting the information at the prompt. When you are finished, you can press Enter to save the changes.

chfn includes several options that allow you to customize the way it modifies the user information. For example, you can use the -f option to specify the full name, the -o option to specify the office location, and the -p option to specify the office phone number.

For example, to change the full name of the user john to John Smith, you can use the following command:

# chfn -f "John Smith" john

chfn Command Examples

1. Update a user’s “Name” field in the output of `finger`:

# chfn -f new_display_name username

2. Update a user’s “Office Room Number” field for the output of `finger`:

# chfn -o new_office_room_number username

3. Update a user’s “Office Phone Number” field for the output of `finger`:

# chfn -p new_office_telephone_number username

4. Update a user’s “Home Phone Number” field for the output of `finger`:

# chfn -h new_home_telephone_number username

Filed Under: Linux

Some more articles you might also be interested in …

  1. ltrace: command not found
  2. hdiutil Command Examples in Mac
  3. CentOS / RHEL 6,7 : How to use yum history to roll back a yum update
  4. How to recover deleted Logical volume (LV) in LVM using vgcfgrestore
  5. virt-sparsify: command not found
  6. yum: command not found
  7. How to Reduce an LVM volume on Ubuntu
  8. CentOS / RHEL 5 : How to install and configure vsftpd server
  9. authconfig: command not found
  10. subscription-manager: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright