User Tools

Site Tools


realuser

Searching for all non-system users (looking for real users)

min=$(grep "^UID_MIN" /etc/login.defs | grep -Eo '[0-9]{1,9}');\
max=$(grep "^UID_MAX" /etc/login.defs | grep -Eo '[0-9]{1,9}'); hostname;  printf "\n | Username%-10s User ID%-11s Shell%-15s \
 Home:\n\n" && cat /etc/passwd | awk -F':' -v "min=$min" -v "max=$max" \
'{ if ( $3 >= min && $3 <= max  && $7 ) print $0 }' "$_p" | awk -F : '{print $1,$3,$7,$6}' | awk '{printf "%-20s %-18s %-20s %-10s\n"," | "$1," "$2," "$3," "$4,""}'

realuser.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki