Last updated 8 months ago
We can check if a user exists on Linux System by id command.
id
id - print real and effective user and group IDs
$ id -u jungle 1000
If a user does not exists on system, it throws an error. For example -
$ id -u unknown id: ‘unknown’: no such user
Source: