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
    > you can get it directly from /etc/passwd

    Unless the system uses LDAP :-)

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,