Solved

Shell script to finger every users

Posted on 1997-12-04
5
474 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 87
has77  challenge 9 67
ShiftLeft challenge 21 66
pre4 challenge 19 88
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now