list all unix accounts and groups on a system

Posted on 2006-04-07
Last Modified: 2013-12-27
Could someone please provide me with the syntax for retrieving all unix accounts and groups on a system? - Thanks!
Question by:sikyala
    LVL 14

    Accepted Solution

    This really depends on how the accounts are being stored.

    If you are using just the files the command is;  
    cat /etc/passwd
    cat /etc/group

    If you are using nis then the command is;    
    ypcat passwd
    ypcat group

    If you are using nis+ then the command is;  
    niscat passwd.org_dir
    niscat group.org_dir

    Many systems use a combination of storage methods, so a machine may have accounts using both files and nis or nis+.

    Author Comment

    This worked great. Thanks!

    If you are using just the files the command is;  
    cat /etc/passwd
    cat /etc/group

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap ( Version 1.2 2.      Jpcap( Version 0.6 Prerequisite: 1.      GCC …
    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.:
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

    728 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

    15 Experts available now in Live!

    Get 1:1 Help Now