Monday, September 16, 2013

List all the users in the system - LINUX/UNIX

What is the command to list users under Linux operating systems?

/etc/passwd file contains one line for each user account, with seven fields delimited by colons. This is a text file. You can easily list users using the cat command as follows 

$ cat /etc/passwd

Sample Output:

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh

No comments:

Post a Comment