Saturday, May 4, 2024
434
rated 0 times [  434] [ 0]  / answers: 1 / hits: 638186  / 2 Years ago, thu, august 11, 2022, 10:18:23

The title says it all. What command I need to run from a terminal to find my user ID (UID)?


More From » command-line

 Answers
4

There are a couple of ways:



  1. Using the id command you can get the real and effective user and group IDs.


     id -u <username>

    If no username is supplied to id, it will default to the current user.



  2. Using the shell variable. (It is not an environment variable, and thus is not available in env).


     echo $UID



[#25165] Saturday, August 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
izeeas

Total Points: 412
Total Questions: 105
Total Answers: 118

Location: Trinidad and Tobago
Member since Fri, May 8, 2020
4 Years ago
;