Solved

Shell script to finger every users

Posted on 1997-12-04
5
478 Views
Last Modified: 2013-12-26
How to write a sh shell script to finger every users(including root, nobody, nobodyV, daemon, bin,.....) in the passwd file ONCE !!!
0
Comment
Question by:clo1
  • 2
  • 2
5 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1295742
for user in `cut -f1 -d: /etc/passwd` ;do
finger $user
done
0
 
LVL 2

Author Comment

by:clo1
ID: 1295743
If I do cat /etc/passwd | wc -l I can get 142 from the command. But if I run the script that ozo given to me. And I will get 146. See what's the different. So there maybe have some duplicated user name
0
 
LVL 84

Expert Comment

by:ozo
ID: 1295744
Or finger may have returned more than one line for some users
maybe you want
finger -sbqpfhm $user

0
 
LVL 2

Author Comment

by:clo1
ID: 1295745
Actually just -m option is good enough for my answer !
0
 
LVL 5

Accepted Solution

by:
n0thing earned 20 total points
ID: 1295746
Hi,

   A simple
     
     cat /etc/passwd | awk -F ':' '{print $1}' | xargs finger

would do.

Regards,
Minh Lai
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ORA-01403: no data found 43 101
only14 challenge 19 75
isEverywhere  challenge 19 75
withoutTen challenge 14 120
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question