- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Ids free in file /etc/passwd -Script-
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2005 07:15 AM
07-13-2005 07:15 AM
Ids free in file /etc/passwd -Script-
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2005 07:25 AM
07-13-2005 07:25 AM
Re: Ids free in file /etc/passwd -Script-
Which id you r looking UID or GID or something else..
For UID
use
cat /etc/passwd|cut -f3 -d ":" |sort -n
This will show the used UID's in sorted order
For GID
cat /etc/passwd|cut -f4 -d ":" |sort -n
regards
CS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2005 07:33 AM
07-13-2005 07:33 AM
Re: Ids free in file /etc/passwd -Script-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2005 07:34 AM
07-13-2005 07:34 AM
Re: Ids free in file /etc/passwd -Script-
Please use this command , to see the UID's used in the order and to find which are not used.
$ cat /etc/passwd | awk -F ":" '{print $3}' | sort -n
Cheers ,
Veri.
------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2005 07:38 AM
07-13-2005 07:38 AM
Re: Ids free in file /etc/passwd -Script-
# man logins
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2005 08:30 AM
07-13-2005 08:30 AM
Re: Ids free in file /etc/passwd -Script-
I tried one script , but for that you need one file with integers 1 to 500 or what ever the last UID you want
I made such a file by
ls -rt /tmp|awk '{print NR}'>numbers
Then sort the UID by
cat /etc/passwd|cut -f3 -d ":">idsort
then write a script
rm /tmp/nonids
for i in `cat /tmp/numbers`
do
j=`grep -x $i idsort; echo $?`
if [ $j -eq 1 ]
then
echo $i>>/tmp/nonids
fi
done
Check the file nonids , it will contain UIDs which were not in the server
Regards
CS