{"id":15671,"date":"2025-11-10T06:48:04","date_gmt":"2025-11-10T06:48:04","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=15671"},"modified":"2025-11-10T06:58:04","modified_gmt":"2025-11-10T06:58:04","slug":"how-to-list-all-users-on-centos-10","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/","title":{"rendered":"How to List All Users on CentOS 10"},"content":{"rendered":"\n<p>Managing user accounts is an important part of Linux administration. Knowing how to list users in CentOS 10 will help you monitor activity and troubleshoot effectively. CentOS provides multiple commands for retrieving this information, whether you are looking to view human accounts, system users, or network users (such as those in LDAP).<\/p>\n\n\n\n<p>This guide will explore the different ways to list users in CentOS 10. We&#8217;ll cover cat, getent, awk, compgen, and many more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"post-15671-_v9ulgxar40hk\"><\/a>How to List All Users on CentOS 10?<\/h2>\n\n\n\n<p>Listing users in CentOS is a fundamental admin task that you can use for audits and scripts. You can also list users to help with troubleshooting, migrations, or other administrative tasks. CentOS 10 has local users in \/etc\/passwd and remote users via LDAP\/NSS\/SSSD. Use getent to ensure reliable results for local and network accounts. awk\/cut can be used for quick filters. Choose the method that best suits your environment and provides the required information.<\/p>\n\n\n\n<p>Each method is explained step by step so that you can quickly identify which approach works best for your environment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_70xnt47ufz06\"><\/a>1) Read \/etc\/passwd<\/h3>\n\n\n\n<p>\/etc\/passwd contains one line per local account with fields separated by. This displays all local users, including system accounts (daemons, postfix, etc.). Use this when you only care about local users and the machine doesn&#8217;t use network authentication.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>cat \/etc\/passwd<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1072\" height=\"710\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-1.png\" alt=\"cat \/etc\/passwd\" class=\"wp-image-15672\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-1.png 1072w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-1-300x199.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-1-1024x678.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-1-768x509.png 768w\" sizes=\"(max-width: 1072px) 100vw, 1072px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>To get only usernames, use the cut command as below:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>cut -d: -f1 \/etc\/passwd<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1077\" height=\"493\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-2.png\" alt=\"cut -d: -f1 \/etc\/passwd\" class=\"wp-image-15673\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-2.png 1077w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-2-300x137.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-2-1024x469.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-2-768x352.png 768w\" sizes=\"(max-width: 1077px) 100vw, 1077px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_25aon98c5q0x\"><\/a>2) Use getent passwd<\/h3>\n\n\n\n<p>getent queries the Name Service Switch and returns entries configured in \/etc\/nsswitch.conf. These sources include local files, LDAP, or NIS. This is a universally recommended way to list local and remote users because it does so consistently.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>getent passwd<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1082\" height=\"645\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-3.png\" alt=\"getent passwd\" class=\"wp-image-15674\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-3.png 1082w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-3-300x179.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-3-1024x610.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-3-768x458.png 768w\" sizes=\"(max-width: 1082px) 100vw, 1082px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>To get usernames only, use the cut command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>getent passwd | cut -d: -f1<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1081\" height=\"363\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-4.png\" alt=\"getent passwd | cut -d: -f1\" class=\"wp-image-15675\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-4.png 1081w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-4-300x101.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-4-1024x344.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-4-768x258.png 768w\" sizes=\"(max-width: 1081px) 100vw, 1081px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_olhsxu8cwfr1\"><\/a>3) Use awk to list just \u201cregular\u201d (human) accounts (UID \u2265 1000)<\/h3>\n\n\n\n<p>On CentOS, system accounts have UIDs below 1000 while human accounts begin at 1000 (this can be controlled in \/etc\/login.defs by UID_MIN). This will print all usernames with a UID of 1000 or more, which are usually real users.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>awk -F: &#8216;$3 &gt;= 1000 {print $1}&#8217; \/etc\/passwd<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1076\" height=\"171\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-5.png\" alt=\"awk -F: '$3 &gt;= 1000 {print $1}' \/etc\/passwd\" class=\"wp-image-15676\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-5.png 1076w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-5-300x48.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-5-1024x163.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-5-768x122.png 768w\" sizes=\"(max-width: 1076px) 100vw, 1076px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>If you want to include network accounts as well:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>getent passwd | awk -F: &#8216;$3 &gt;= 1000 {print $1}&#8217;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1081\" height=\"162\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-6.png\" alt=\"getent passwd | awk -F: '$3 &gt;= 1000 {print $1}'\" class=\"wp-image-15677\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-6.png 1081w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-6-300x45.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-6-1024x153.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-6-768x115.png 768w\" sizes=\"(max-width: 1081px) 100vw, 1081px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_ism2x6e58uz4\"><\/a>4) List interactive (login-capable) users<\/h3>\n\n\n\n<p>This filters out accounts with shells of \/usr\/sbin\/nologin or \/bin\/false. These shells are often used to block interactive logins. Combining with UID checks will show only human accounts.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>awk -F: &#8216;($7 !~ \/(nologin|false|\\\/sbin\\\/nologin|\\\/usr\\\/sbin\\\/nologin)\/) &amp;&amp; ($3 &gt;= 1000) {print $1}&#8217; \/etc\/passwd<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1077\" height=\"169\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-7.png\" alt=\"awk -F: '($7 !~ \/(nologin|false|\\\/sbin\\\/nologin|\\\/usr\\\/sbin\\\/nologin)\/) &amp;&amp; ($3 &gt;= 1000) {print $1}' \/etc\/passwd\" class=\"wp-image-15678\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-7.png 1077w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-7-300x47.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-7-1024x161.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-7-768x121.png 768w\" sizes=\"(max-width: 1077px) 100vw, 1077px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_wsey4uscnzv9\"><\/a>5) Use the Bash builtin compgen -u<\/h3>\n\n\n\n<p>compgen -u displays all usernames that are known to the shell. (It queries NSS). This is a quick way to check usernames, but the output (only usernames) is not adorned. It works with interactive shells and scripts.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>compgen -u<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1077\" height=\"537\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-8.png\" alt=\"compgen -u\" class=\"wp-image-15679\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-8.png 1077w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-8-300x150.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-8-1024x511.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-8-768x383.png 768w\" sizes=\"(max-width: 1077px) 100vw, 1077px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_306vzpgqgk34\"><\/a>6) Use lslogins to get richer account info<\/h3>\n\n\n\n<p>lslogins prints a table that includes username, UID, and last login. It also shows the home directory, shell, and other information. This is a great way to get a comprehensive overview. Only for compact usernames:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>lslogins<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1071\" height=\"697\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-9.png\" alt=\"lslogins\" class=\"wp-image-15680\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-9.png 1071w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-9-300x195.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-9-1024x666.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-9-768x500.png 768w\" sizes=\"(max-width: 1071px) 100vw, 1071px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>If you want to get information about the root and local username, use the below:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>lslogins -u<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1076\" height=\"190\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-10.png\" alt=\"lslogins -u\" class=\"wp-image-15681\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-10.png 1076w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-10-300x53.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-10-1024x181.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-10-768x136.png 768w\" sizes=\"(max-width: 1076px) 100vw, 1076px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_d4zn1v574nip\"><\/a>7) Count users<\/h3>\n\n\n\n<p>The total number of users (local and network) is shown. To count regular users:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>getent passwd | wc -l<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1075\" height=\"141\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-11.png\" alt=\"getent passwd | wc -l\" class=\"wp-image-15682\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-11.png 1075w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-11-300x39.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-11-1024x134.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-11-768x101.png 768w\" sizes=\"(max-width: 1075px) 100vw, 1075px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_7kg26lx34dta\"><\/a>8) List currently logged-in users<\/h3>\n\n\n\n<p>They only show the current session, not all of your accounts.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>who<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1073\" height=\"154\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-12.png\" alt=\"who\" class=\"wp-image-15683\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-12.png 1073w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-12-300x43.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-12-1024x147.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-12-768x110.png 768w\" sizes=\"(max-width: 1073px) 100vw, 1073px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Or<\/p>\n\n\n\n<p>You can use them to check who is currently logged in (especially useful during maintenance).<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>w<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1074\" height=\"226\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-13.png\" alt=\"w\" class=\"wp-image-15684\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-13.png 1074w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-13-300x63.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-13-1024x215.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-13-768x162.png 768w\" sizes=\"(max-width: 1074px) 100vw, 1074px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_dfh6uw2c32x7\"><\/a>9) Show locked accounts<\/h3>\n\n\n\n<p>Search for accounts that have !, *, or !. This indicates that the account is locked or there is no password. Root must be able to read \/etc\/shadow.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo awk -F: &#8216;($2 ~ \/^!|^\\*|^!!\/) {print $1}&#8217; \/etc\/shadow<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1081\" height=\"616\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-14.png\" alt=\"sudo awk -F: '($2 ~ \/^!|^\\*|^!!\/) {print $1}' \/etc\/shadow\" class=\"wp-image-15685\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-14.png 1081w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-14-300x171.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-14-1024x584.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-14-768x438.png 768w\" sizes=\"(max-width: 1081px) 100vw, 1081px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_5i1v6fj60vj9\"><\/a>10) Show accounts allowed to use sudo<\/h3>\n\n\n\n<p>It will show you the members of your sudo group or wheel group, depending on which distro you use. This is useful to see users with admin rights.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>getent group sudo wheel | cut -d: -f4<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1077\" height=\"140\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-15.png\" alt=\"getent group sudo wheel | cut -d: -f4\" class=\"wp-image-15686\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-15.png 1077w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-15-300x39.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-15-1024x133.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-15-768x100.png 768w\" sizes=\"(max-width: 1077px) 100vw, 1077px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_m8pq8s4ry2yq\"><\/a>11) GUI \/ Control Panel methods<\/h3>\n\n\n\n<p>You can find local accounts on the Users page of a control panel. These are great for point-and-click admin.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1195\" height=\"737\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-16.png\" alt=\"List users in centos 10 using gui\" class=\"wp-image-15687\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-16.png 1195w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-16-300x185.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-16-1024x632.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/word-image-15671-16-768x474.png 768w\" sizes=\"(max-width: 1195px) 100vw, 1195px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-15671-_jfsnkeicb4tt\"><\/a>Best practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Getent is better than reading \/etc\/passwd, if you&#8217;re using LDAP\/SSSD\/NIS. It returns the actual resolutions of your system.<\/li>\n\n\n\n<li>Check UID_MIN at \/etc\/login.defs for the threshold of system users vs. regular users (CentOS uses 1000).<\/li>\n\n\n\n<li>The shell field (\/sbin\/nologin or \/bin\/false) shows how many services disable log-ins. Filter by shell if you want only human accounts.<\/li>\n\n\n\n<li>Root privileges are required to read \/etc\/shadow and make accurate checks on locked accounts.<\/li>\n\n\n\n<li>Tip for scripting: Use getent passwd when you want to be able to port your scripts across different auth backends.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"post-15671-_v6ffkyh3vrs0\"><\/a>Conclusion<\/h2>\n\n\n\n<p>To list all users on CentOS 10, you can use several methods depending on your needs. The simplest way is to view the local user database with cat \/etc\/passwd, which lists all system and user accounts, or use cut -d: -f1 \/etc\/passwd to display only usernames. For a more comprehensive list, including network or LDAP users, use getent passwd.<\/p>\n\n\n\n<p>To display only regular human users (those with UID \u2265 1000), run awk -F: &#8216;$3 &gt;= 1000 {print $1}&#8217; \/etc\/passwd. You can also use compgen -u for a quick list of all usernames or lslogins to see detailed account information. Each of these commands helps you view different user categories, from system accounts to active login users, depending on what you want to check.<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Managing user accounts is an important part of Linux administration. Knowing how to list users in CentOS 10 will help you monitor activity and troubleshoot effectively. CentOS provides multiple commands for retrieving this information, whether you are looking to view human accounts, system users, or network users (such as those in LDAP). This guide will [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":15690,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[958,974],"class_list":["post-15671","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-centos-10","tag-list-users"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to List All Users on CentOS 10 - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"This guide will explore the different ways to list users in CentOS 10. We&#039;ll cover cat, getent, awk, compgen, and many more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to List All Users on CentOS 10 - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"This guide will explore the different ways to list users in CentOS 10. We&#039;ll cover cat, getent, awk, compgen, and many more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-10T06:48:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-10T06:58:04+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to List All Users on CentOS 10\",\"datePublished\":\"2025-11-10T06:48:04+00:00\",\"dateModified\":\"2025-11-10T06:58:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/\"},\"wordCount\":899,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg\",\"keywords\":[\"CentOS 10\",\"List Users\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/\",\"name\":\"How to List All Users on CentOS 10 - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg\",\"datePublished\":\"2025-11-10T06:48:04+00:00\",\"dateModified\":\"2025-11-10T06:58:04+00:00\",\"description\":\"This guide will explore the different ways to list users in CentOS 10. We'll cover cat, getent, awk, compgen, and many more.\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg\",\"width\":1020,\"height\":600,\"caption\":\"List Users on CentOS 10\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to List All Users on CentOS 10\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to List All Users on CentOS 10 - Greenwebpage Community","description":"This guide will explore the different ways to list users in CentOS 10. We'll cover cat, getent, awk, compgen, and many more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/","og_locale":"en_US","og_type":"article","og_title":"How to List All Users on CentOS 10 - Greenwebpage Community","og_description":"This guide will explore the different ways to list users in CentOS 10. We'll cover cat, getent, awk, compgen, and many more.","og_url":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/","og_site_name":"Greenwebpage Community","article_published_time":"2025-11-10T06:48:04+00:00","article_modified_time":"2025-11-10T06:58:04+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to List All Users on CentOS 10","datePublished":"2025-11-10T06:48:04+00:00","dateModified":"2025-11-10T06:58:04+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/"},"wordCount":899,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg","keywords":["CentOS 10","List Users"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/","url":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/","name":"How to List All Users on CentOS 10 - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg","datePublished":"2025-11-10T06:48:04+00:00","dateModified":"2025-11-10T06:58:04+00:00","description":"This guide will explore the different ways to list users in CentOS 10. We'll cover cat, getent, awk, compgen, and many more.","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/11\/List-Users-on-CentOS-10.jpg","width":1020,"height":600,"caption":"List Users on CentOS 10"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-list-all-users-on-centos-10\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to List All Users on CentOS 10"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/15671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=15671"}],"version-history":[{"count":2,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/15671\/revisions"}],"predecessor-version":[{"id":15689,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/15671\/revisions\/15689"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/15690"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=15671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=15671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=15671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}