Manage User Accounts and Privileges in Ubuntu

1. List all users in Ubuntu

    cut -d: -f1 /etc/passwd

    Explanation:

    cut : command-line utility that extracts sections from lines of a file or input

    -d: : delimiter as a colon (:) to separate fields

    -f1 : tells cut to extract field 1, which is username

    /etc/passwd : contains all user account information

    2. Create new user account

    sudo adduser auser

    3. Create a user with sudo privileges

    sudo adduser puser

    sudo usermod -aG sudo puser