HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Mass Deletion of Users
Operating System - HP-UX
1834047
Members
2803
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-02-2001 07:59 AM
07-02-2001 07:59 AM
Hello Everyone,
I have about 50 users I have to delete. Each entry in the passwd file is marked with "disabled". Is there an easy way to do this? Or do I have to do userdel -r for each entry?
Any help would be appreciated. Thanks in advance.
John
I have about 50 users I have to delete. Each entry in the passwd file is marked with "disabled". Is there an easy way to do this? Or do I have to do userdel -r for each entry?
Any help would be appreciated. Thanks in advance.
John
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2001 08:04 AM
07-02-2001 08:04 AM
Re: Mass Deletion of Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2001 08:21 AM
07-02-2001 08:21 AM
Solution
Hi John:
You could easily build a temporary script to verify the list your going to delete. For example, if the fifth field (the identification one) of /etc/passwd contained "Disabled", then:
# awk -F: '$5~/Disabled/ {print "userdel -r " $1}' /etc/passwd > /tmp/deleteusers
would create the file of user delete statements for you to review, edit, and or process.
...JRF...
You could easily build a temporary script to verify the list your going to delete. For example, if the fifth field (the identification one) of /etc/passwd contained "Disabled", then:
# awk -F: '$5~/Disabled/ {print "userdel -r " $1}' /etc/passwd > /tmp/deleteusers
would create the file of user delete statements for you to review, edit, and or process.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2001 08:33 AM
07-02-2001 08:33 AM
Re: Mass Deletion of Users
Hi John!
try the following:
grep -i disable /etc/passwd|cut -d ":" -f1 > /tmp/disable_users| while read USER; do
userdel -r $USER; done < /tmp/disabe_users
good luck.
try the following:
grep -i disable /etc/passwd|cut -d ":" -f1 > /tmp/disable_users| while read USER; do
userdel -r $USER; done < /tmp/disabe_users
good luck.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP