| 
     
       |  |  |  | 
            
              | 
             
               | 
               
                 |  | UGU: Unix Guru Universe - Unix Tip #4420- April 18, 2025
 -  Home : Help
 : Today's Tip Unix Tip #4420- April 18, 2025
 
 
THE NEXT UID 
Here is one way to find out the
 next available UID on a system.
 
 It takes both the password and
 group files and finds the next
 available UID and displays it.
 
 (No cats were harmed in the making
 of this script)
 
 #!/bin/bash
 awk -F":" '{ print $3 }' /etc/passwd > number_list
 awk -F":" '{ print $3 }' /etc/group >> number_list
 A=` sort -g number_list | tail -1`
 A=`expr $A + 1`
 echo "New Available UID is $A"
 
 
 
 NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into
production.
 
 LAST 5 TIPS
 4419
 - TRANSFERRING MULTIBYTE FILES
 4418
 - LOGGING MAKES
 4417
 - ALIAS YOUR CONNECTIVITY
 4416
 - CHECK SENDMAIL SETTINGS
 4415
 - IS YOUR HARDWARE GETTING STOLEN?
 I want to 
 SUBSCRIBE
 and get a UGU Tip everyday.
 I want to 
 UNSUBSCRIBE
 and NOT get a UGU Tip everyday.
 If you have a UNIX TIP let us know, we just may use it:
(All tips become the property of the Unix Guru Universe)
 |  |  
                 |  |  
                 |   Copyright 1994-2024 Unix Guru Universe 
 |  |  |  |  |