Mohammad Ali Akbari Asked: 2011-05-01 01:28:42 +0800 CST2011-05-01 01:28:42 +0800 CST 2011-05-01 01:28:42 +0800 CST How can I get user name by user ID? 772 In my FTP client I can see files' owner ID (99). How do I find out which user is the owner of these files? linux centos 3 Answers Voted Best Answer Paul Haldane 2011-05-01T14:09:15+08:002011-05-01T14:09:15+08:00 Shorter getent version (as long as you don't need just the username) $ getent passwd 99 nobody:x:99:99:Nobody:/:/sbin/nologin Works on at least CentOS 5.6 - will take username or uid as key. Ignacio Vazquez-Abrams 2011-05-01T01:39:36+08:002011-05-01T01:39:36+08:00 $ getent passwd | awk -F: '$3 == 99 { print $1 }' nobody Piotr 2011-05-01T01:38:22+08:002011-05-01T01:38:22+08:00 The quickest way to check it (if you have a shell access) is to: cat /etc/passwd | grep 99 Btw UID 99 usually belongs to "nobody" user.
Shorter getent version (as long as you don't need just the username)
Works on at least CentOS 5.6 - will take username or uid as key.
The quickest way to check it (if you have a shell access) is to: cat /etc/passwd | grep 99
Btw UID 99 usually belongs to "nobody" user.