- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: passwd file
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
04-23-2002 05:09 AM
04-23-2002 05:09 AM
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 05:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 05:18 AM
04-23-2002 05:18 AM
Re: passwd file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 05:21 AM
04-23-2002 05:21 AM
Re: passwd file
awk -F: '{printf "%-10s %6s %6s %-25s\n", $1, $3, $4, $5}' /etc/passwd | sort
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 05:22 AM
04-23-2002 05:22 AM
Re: passwd file
#!/bin/ksh
IFS=:
exec 0while read -r Name PW UID GID Gecos Home Shell
do
print "$Name $UID $GID $Gecos"
done
This is how you can run it ..
# testscript | sort
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 05:24 AM
04-23-2002 05:24 AM
Re: passwd file
You can use the cut command on /etc/passwd file and extract the information.
1. to get the username
cut -d":" -f1 /etc/passwd
2. To get the userid
cut -d":" -f3 /etc/passwd
3. To get the groupid
cut -d":" -f4 /etc/passwd
and the comments
cut -d":" -f5 /etc/passwd
Regards,
Sukant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 05:29 AM
04-23-2002 05:29 AM
Re: passwd file
# awk -F: '{print $1 " " $3 " " $4 " " $5}' /etc/passwd | sort
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 05:56 AM
04-23-2002 05:56 AM
Re: passwd file
This is only an optimized version for the cut solution:
cut -d":" -f1,3,4,5 /etc/passwd |sort
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 07:38 PM
04-23-2002 07:38 PM
Re: passwd file
Here is a good one !! use the
following hp-ux command
# /usr/sbin/logins -t
--Niraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2002 11:29 PM
04-23-2002 11:29 PM
Re: passwd file
i would also add the "-m" option to the logins command to display multiple group membership data.
logins -t -m
hope this helps
Best Regards
yogeeraj