Does anyone know how do I list existing alias for a certain Unix/Linux user on Debian? For example I have an Unix/Linux user 1001 and want to know which alias for login it has?
I assume you have a user with a numerical user id (
uid) of 1001 and want its user name:
getent passwd 1001
will show this information.
If it's a local user you can grep
/etc/passwd for it. Like following:
grep 1001 /etc/passwd
If it's a non-local user, it depends on the DB backend that is used to store him in. For example if you use NIS you may check with
cd /etc ypcat passwd | grep 1001
For other DB backends you'll have to check the specific ways to search for a user by UID.