How to get current user's UID on Linux

Run

id-commands.sh
id -u

to get the current user’s UID. Example:

id-commands.sh
$ id -u
1000

You can also get another user’s UID:

id-commands.sh
$ id -u root
0

 


Check out similar posts by category: Linux