This question already has an answer here:
I am new in linux
. I need to know user name from given user id in my c application. Is there any linux api
function available to get this?
Thanks
This question already has an answer here:
I am new in linux
. I need to know user name from given user id in my c application. Is there any linux api
function available to get this?
Thanks
If you want to get the username from a c program then
getpwuid
is probably the easiest way. Man entry here: http://man7.org/linux/man-pages/man3/getpwnam.3.htmlFrom the command line, I would just grep through passwd: