User Tools

Site Tools


realuser

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
realuser [2015/04/09 14:13] – created luke7858realuser [2024/05/23 07:26] (current) – external edit 127.0.0.1
Line 1: Line 1:
 Searching for all non-system users (looking for real users) Searching for all non-system users (looking for real users)
 <sxh bash> <sxh bash>
-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,""}'+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,""}'
 </sxh> </sxh>
realuser.1428588795.txt.gz · Last modified: 2024/05/23 07:26 (external edit)

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