in reply to List all Users Directory
I'm trying to list all users' home directories from a linux host.
You don't need a regex for that, you can get it directly from /etc/passwd. eg:
perl -F: -nae 'print "$F[0] has home dir $F[5]\n" if $F[5];' /etc/pass +wd
Of course, you can change the test in there to be a regex match if you want to restrict the output, but it might be simpler to restrict it by UID range or similar. This should get you started anyway.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: List all Users Directory
by choroba (Cardinal) on Dec 13, 2016 at 22:19 UTC |