# While we can't manipulate users, there is a bunch of commands that # print information and which are available to us. Let's have a # look. The first command to check out is called simply ‹w›. Note # that the command ‹head› as used here discards all but the first 5 # lines of output. echo output from w w | head -n 5 # The command prints information about users who are logged on, # along with commands that they are currently executing. A more # basic (and more standard) variant is a command called ‹who›, which # only prints a subset of the info provided by ‹w›. Most notably, # the currently executed command is missing: echo echo output from who who | head -n 5 # Feel free to experiment with those commands yourself. To learn # your own username, you can use the command ‹whoami› (who am i?), # like this: echo echo info about the current user whoami # To print the list of groups attached to the active session, we can # use ‹groups›. There can be more than one. groups # Finally, the info from the two previous commands, along with some # extras, can be obtained from ‹id›. Unlike ‹groups›, this tells us # which group is primary and also gives numeric identifiers for each # piece of information. The output of ‹id› is meant to be machine # readable. id # The last two commands can be also invoked on other users (i.e. not # yourself). This works as follows: echo echo info about the user kontr groups kontr id kontr # This is about all the user- and group-related commands that we # will look at. Let's have a quick look at ‹passwd.txt› before # going on to C.