chfn - Unix, Linux Command


Advertisements

Previous Page
Next Page  
 

NAME

chfn - change your finger information

SYNOPSIS

chfn [-f full-name] [-o office] ,RB [ -p office-phone] [-h home-phone] -u] [-v] [username] 

DESCRIPTION

chfn is used to change your finger information. This information is stored in the /etc/passwd file, and is displayed by the finger program. The Linux finger command will display four pieces of information that can be changed by chfn: your real name, your work room and phone, and your home phone. The chfn command changes user fullname, office room number, office phone number, and home phone number information for a user's account. This information is typically printed by finger(1) and similar programs. A normal user may only change the fields for her own account,subject to the restrictions in /etc/login.defs. (The default configuration is to prevent users from changing their fullname.) The superuser may change any field for any account. Additionally, only the superuser may use the -o option to change the undefined portions of the GECOS field.

OPTIONS

Tag Description
-f, --full-name Specify your real name.
-o, --office office Specify your office room number.
-p, --office-phone office-phone Specify your office phone number.
-h, --home-phone home-phone Specify your home phone number.
-u, --help Print a usage message and exit.
-v, --version Print version information and exit.

EXAMPLES

EXAMPLE-1:

To Change finger information:

# chfn 
or
$ sudo chfn
(Running the command without any options will enable the user to change all the user information.)

output:
Changing the user information
Enter the new value, or press ENTER for the default
Full Name [test]: test-new
Room Number [1]: 2
Work Phone [123456]:
Home Phone [654321]:
Other []:

EXAMPLE-2:

To use option -f to change only the Full Name:

# chfn -f "Newuser"
Changing finger information for Newuser. Password: Finger information changed. $ finger Newuser Login: Newuser Name: Newuser Directory: /home/Newuser Shell: /bin/bash Office: 3rd floor room 313, +91-123456 Home Phone:6666 On since Sat Oct 19 07:38 (PDT) on pts/0 from 192.168.1.205 New mail received Sat Oct 19 03:08 2016 (PDT) Unread since Tue May 28 15:31 2016 (PDT) No Plan. 

EXAMPLE-3:

Use option -o to change only the Office location:

# chfn -o "4th floor room 414" Newuser
Changing finger information for Newuser. Password: Finger information changed. $ finger Newuser Login: Newuser Name: Newuser Directory: /home/Newuser Shell: /bin/bash Office: 4th floor room 414, 111-222-3333 Home Phone: 444-555-6666 On since Sat Oct 19 07:38 (PDT) on pts/0 from 192.168.1.2 New mail received Sat Oct 19 03:08 2013 (PDT) Unread since Tue May 28 15:31 2013 (PDT) No Plan. 

EXAMPLE-4:

Use option -p to change only the office phone number:

# chfn -p "111-111-1111" Newuser
Changing finger information for Newuser. Password: Finger information changed. $ finger Newuser Login: Newuser Name: Newuser Directory: /home/Newuser Shell: /bin/bash Office: 4th floor room 414, 111-111-1111 Home Phone: 444-555-6666 On since Sat Oct 19 07:38 (PDT) on pts/0 from 192.168.1.2 New mail received Sat Oct 19 03:08 2013 (PDT) Unread since Tue May 28 15:31 2013 (PDT) No Plan.

 EXAMPLE-5:

Use option -h to change only the home phone number as shown below.

# chfn -h "222-222-2222" Newuser
Changing finger information for Newuser. Password: Finger information changed. $ finger Newuser Login: Newuser Name: Newuser Directory: /home/Newuser Shell: /bin/bash Office: 4th floor room 414, 111-111-1111 Home Phone: 222-222-2222 On since Sat Oct 19 07:38 (PDT) on pts/0 from 192.168.1.2 New mail received Sat Oct 19 03:08 2013 (PDT) Unread since Tue May 28 15:31 2013 (PDT) No Plan.

Previous Page
Next Page