Results 1 to 2 of 2
Hi,
I need a shell script which lists all users listed in /etc/passwd file. This script should show all the users created.
Is it possible to extract only users with ...
- 09-15-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 1
All users in /etc/passwd file
Hi,
I need a shell script which lists all users listed in /etc/passwd file. This script should show all the users created.
Is it possible to extract only users with different shells? Please reply..
- 09-15-2007 #2Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Well, you could use cat, or grep can select lines based on specific patterns. If you want to pick out certain fields you could do something with awk:
which will list the GECOS field followed by the userid and login shell.Code:awk -F: '{print $5, "(" $1, "-", $7 ")"}' /etc/passwd


Reply With Quote