From 5a2cd55a0264085e2fd66379b29f17016c46c97d Mon Sep 17 00:00:00 2001 From: Michele Sessa Date: Wed, 11 Jan 2023 12:54:35 +0000 Subject: [PATCH] docs(check-user): add more hints and details about getent --- subjects/devops/check-user/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/subjects/devops/check-user/README.md b/subjects/devops/check-user/README.md index 187b05eb..1156c2eb 100644 --- a/subjects/devops/check-user/README.md +++ b/subjects/devops/check-user/README.md @@ -30,10 +30,16 @@ $ ### Error handling All errors will print a specific message on **stderr** (ending with a newline) and returns a specific non-zero value: -- Wrong number of arguments: `"Error: expect 2 arguments"`, returns `1`. +- Wrong number of arguments: `"Error: expect 2 arguments"`, exit with `1`. - First argument different from `-e` or `-i`: `"Error: unknown flag"`, exit with `1`. ### Hints +- `getent` is a command to get entries from a database. `passwd` is the database where information about users is stored. +- `getent passwd` will give you the list of all users. +- `getent passwd ` will give you information about a specific user. +- If the user doesn't exists `getent` returns an empty string, use this at your advantage for `-e` flag. -> `man getent` will be a great resource to explore +> `man getent` will provide extensive documentation about this command. + +### Resources > [List Linux users](https://linuxize.com/post/how-to-list-users-in-linux/)