Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Shell script to finger every users

Posted on 1997-12-04
5
Medium Priority
?
494 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 85

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 85

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

972 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