Identifying user accounts in macOS (Catalina) can be achieved using the following command
dscl . -list /Users | grep -vE '_|root|nobody|daemon|Guest'
Which gives me the below output.Note: hiddenswasti
is a hidden account (not visible in the login/welcome screen) while swastibhushandeb
is a normal account.
Referring to a post here ,it is inferred that the user specific plist files residing in var/db/dslocal/nodes/Default/users
can be read using defaults read
or plutil -p
and contains valuable information to ascertain if an account is hidden or otherwise.
Issue I am facing is to develop a one liner code (using bash )is utilizing the output of the dscl
command detailed above and use generated output as input to plutil -p
to read the contents of hiddenswasti.plist
and swastibhushandeb.plist
. Would appreciate help.Thanks in advance.
hiddenswasti.plist
is stored, why not just runplutil
on it?sudo dscl . -list /Users | grep -vE '_|root|nobody|daemon|Guest'|xargs -0 -n 1 sh -c 'sudo plutil -p /var/db/dslocal/nodes/Default/users/"$1.plist"' _
-0
part)