- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: last command output
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
Discussions
Discussions
Forums
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
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-06-2010 03:25 AM
тАО04-06-2010 03:25 AM
1)I have HP-UX 11i v2, i would like to subtitute from output of "last" command to get only user name and date (day & time) how this possible?
2) As I have to check which user logged in and when exactly?
3) And which user is created but not logged in since long time back?
Regards,
Faisal M.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2010 03:52 AM
тАО04-06-2010 03:52 AM
Solutionlast | awk '{ print $1 " " $3 " " $4 " " $5 " " $6 }'
That should take care of question 1. For 2, you could use grep to selectively print the user.
For 3, you could try finger:
for i in `cat /etc/passwd | awk -F : '{ print $1 }
do
finger $i |grep Never
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2010 04:10 AM
тАО04-06-2010 04:10 AM
Re: last command output
Thanks for your kind response, for Q3, finger doesn't get any output just only '>'
what could be the reason...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2010 04:22 AM
тАО04-06-2010 04:22 AM
Re: last command output
> Mr. Pete, Thanks for your kind response, for Q3, finger doesn't get any output just only '>'
This is the shell telling you that it expects additional input before it processes your command.
Pete simply forgot a 'done' to complete the 'do' loop.
You could also eliminate the extra 'cat' process by doing:
for USER in $(awk -F: '{print $1}' /etc/passwd)
do
finger ${USER}
done
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2010 04:40 AM
тАО04-06-2010 04:40 AM
Re: last command output
Thanks for your kind response,
what about for never logged in do i have to add upon what you said, |grep Never?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2010 04:50 AM
тАО04-06-2010 04:50 AM
Re: last command output
> what about for never logged in do i have to add upon what you said, |grep Never?
Yes, I missed that Pete had covered that nicely :-(
Regards!
...JRF...