The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-22-2007
gus2000 gus2000 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 157
I love one-line commands.


Code:
(last | awk '{print$1}'; awk -F: '{print$1}' /etc/passwd) | sort | uniq -u

The command "uniq -u" show only unrepeated lines, which would be "users in passwd but NOT in wtmp".