1 |
On Thursday, April 14, 2016 09:03:08 AM Neil Bothwick wrote: |
2 |
> On Thu, 14 Apr 2016 02:58:09 -0500, Dale wrote: |
3 |
> > While at it, what is a command that lists all the users that are set up |
4 |
> > on a system? I tried a couple things but only found one that lists who |
5 |
> > is currently logged in. I would like them all listed. |
6 |
> |
7 |
> cat /etc/passwd ;-) |
8 |
> |
9 |
> Or if you want to get clever and give just a list of usernames |
10 |
> |
11 |
> awk -F: '{print $1}' /etc/passwd |
12 |
|
13 |
This doesn't work when using LDAP authentication or similar: |
14 |
|
15 |
nas ~ # cat /etc/passwd | grep joost |
16 |
nas ~ # getent passwd | grep joost |
17 |
joost:x:1000:1000:System User:/home/joost:/bin/bash |
18 |
nas ~ # |
19 |
|
20 |
-- |
21 |
Joost |