Solved

Ypcat passwd

Posted on 1998-09-07
2
1,267 Views
Last Modified: 2006-11-17
I need ypcat passwd to only give
me the users full name and no
other info. What switches do I
use????

Thanks
0
Comment
Question by:Lukemann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
braveheart earned 100 total points
ID: 2006899
There are no suitable switches but try piping it through nawk or awk or sed or cut. Here is a nawk example:

ypcat passwd | nawk -F: '{print $5}'

This assumes that the full user name appears in field 5 but it may be in a different field (delimited by ':') on your system.

You may also want to pipe it through uniq or sort -u.
0
 

Author Comment

by:Lukemann
ID: 2006900
I ended up using ypcat password | head | cut -d: -f5 | sort
to take out the names.  Using uniq is also a very good tip...
I need to find out who has multiple accounts and this will
come in handy

Thanks!!!!!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

735 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