cat /etc/passwd|cut -f 1 -d \":\" Or echo \"Enter user name : \" read lname grep $lname /etc/passwd | cut -d\":\" -f 1-7