List of Users in Linux – Ubuntu


I was required to search a username hduser on my newly installed Ubuntu. I was required as well to search all users in Ubuntu. Here what I did

Solution:
  1.  cat /etc/passwd  [ This will list all users in the file. There may be some system and services users as well]
  2. cat /etc/passwd | grep /home | cut -d: -f1 [This file will only give you users, in use]
  3. ls /home/ [This command only help you, if your newly user at least once connected to system]

Comments