{"id":15212,"date":"2026-03-05T12:06:35","date_gmt":"2026-03-05T12:06:35","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=15212"},"modified":"2026-03-05T12:31:36","modified_gmt":"2026-03-05T12:31:36","slug":"check-logged-in-users-linux","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/","title":{"rendered":"How to Check How Many Users Are Logged In on Linux"},"content":{"rendered":"<p>Linux is a multi\u2011user operating system, which means several people can be logged in at the same time locally, remotely, or through different terminals. As a system administrator, knowing how many users are online helps you troubleshoot performance issues, monitor activity, and manage sessions more effectively. Linux provides several built\u2011in commands that make this easy.<\/p>\n<h3><strong>What Does \u201cUsers Online\u201d Mean in Linux?<\/strong><\/h3>\n<p>When we talk about \u201cusers online,\u201d we are referring to accounts that have an active session on the system. This can include users connected through SSH, working on a local terminal, or logged in through remote tools. Linux records all login activity, and the system commands below help you view this information quickly.<\/p>\n<h3><strong>Basic Commands to Find Logged\u2011In Users<\/strong><\/h3>\n<p>Below are the most useful commands for checking user activity. Each command serves a slightly different purpose.<\/p>\n<h4><strong>1. <code>who<\/code> &#8211;\u00a0 Show Active Login Sessions<\/strong><\/h4>\n<p>The <code>who<\/code> command lists all users currently logged in and their session details.<\/p>\n<p><strong>Example: <\/strong>who<\/p>\n<p><strong>What it shows:<\/strong><\/p>\n<ul>\n<li>Username<\/li>\n<li>Terminal\/TTY<\/li>\n<li>Login time<\/li>\n<li>Remote host (if applicable)<\/li>\n<\/ul>\n<h4><strong>2. <code>w<\/code>\u00a0 &#8211; Show Logged\u2011In Users with Activity<\/strong><\/h4>\n<p><code>w<\/code> provides a more detailed view, showing both user logins and what each user is doing.<\/p>\n<p><strong>Example: <\/strong>w<\/p>\n<p><strong>What it shows:<\/strong><\/p>\n<ul>\n<li>Logged\u2011in users<\/li>\n<li>Idle time<\/li>\n<li>CPU usage<\/li>\n<li>Commands currently running<\/li>\n<\/ul>\n<h4><strong>3. <code>users<\/code>\u00a0 &#8211; Quick List of Logged\u2011In Users<\/strong><\/h4>\n<p><code>users<\/code> gives a simple, space\u2011separated list of usernames.<\/p>\n<p><strong>Example: <\/strong>users<\/p>\n<p><strong>Useful when:<\/strong> You only need the usernames without additional details.<\/p>\n<h4><strong>4. <code>last<\/code> &#8211; View Recent Login History<\/strong><\/h4>\n<p>While not limited to current sessions, <code>last<\/code> helps you review previous logins and reboots.<\/p>\n<p><strong>Example: <\/strong>last<br \/>\n<strong>Useful for:<\/strong> Auditing user access over time.<\/p>\n<h4><strong>5. <code>whoami<\/code>\u00a0 &#8211; Display the Current User<\/strong><\/h4>\n<p>This command shows the username of the session you\u2019re in right now.<\/p>\n<p><strong>Example: <\/strong>whoami<\/p>\n<h3><strong>How to Count the Number of Active Users<\/strong><\/h3>\n<p>To see the <strong>number<\/strong> of logged\u2011in users, you can combine commands with simple shell utilities.<\/p>\n<h5><strong>1. Count using <code>users<\/code> + <code>wc<\/code>:<\/strong><\/h5>\n<p>users | wc -w<\/p>\n<h5><strong>2. Count using <code>who<\/code> + <code>wc<\/code>:<\/strong><\/h5>\n<p>who | wc -l<\/p>\n<h5><strong>3. Count unique users:<\/strong><\/h5>\n<p>who | awk &#8216;{print $1}&#8217; | sort -u | wc -l<\/p>\n<h4><strong>Checking Detailed Information About User Sessions<\/strong><\/h4>\n<p>Linux also stores session data in special system files:<\/p>\n<ul>\n<li><code>\/var\/run\/utmp<\/code>\u00a0 &#8211; current logins<\/li>\n<li><code>\/var\/log\/wtmp<\/code>\u00a0 &#8211; login history<\/li>\n<li><code>\/var\/log\/btmp<\/code>\u00a0 &#8211; failed login attempts<\/li>\n<\/ul>\n<p>Some commands read from these files automatically, so you rarely need to access them directly.<\/p>\n<h4><strong>Monitoring Remote Users (SSH)<\/strong><\/h4>\n<p>To specifically see SSH users:<br \/>\n<code>who | grep pts<\/code><br \/>\nOr check SSH sessions with:<br \/>\n<code>ss -t -a | grep ssh<\/code><\/p>\n<h4><strong>Getting Help for User Monitoring Commands<\/strong><\/h4>\n<p>Linux provides built\u2011in help for all commands:<\/p>\n<ul>\n<li>man who<\/li>\n<li>man w<\/li>\n<li>man users<\/li>\n<\/ul>\n<p>Or use:<\/p>\n<ul>\n<li><!--ScriptorStartFragment-->&lt;command&gt; &#8211;help<!--ScriptorEndFragment--><\/li>\n<\/ul>\n<p>This gives you additional examples and command\u2011specific options.<\/p>\n<h5><strong>Conclusion<\/strong><\/h5>\n<p>Linux offers several quick and reliable ways to check who is currently online. Commands like <code>who<\/code>, <code>w<\/code>, and <code>users<\/code> help you see active sessions, while tools like <code>last<\/code> show login history. Whether you&#8217;re monitoring an <a href=\"https:\/\/www.bodhost.com\/kb\/how-to-ssh-a-server-or-ssh-server-access\/\" target=\"_blank\" rel=\"noopener\">SSH server<\/a> or managing multiple users on a shared machine, these built\u2011in commands give you everything you need to track user activity effectively.<\/p>\n<p>Discover <a href=\"https:\/\/www.bodhost.com\/kb\/how-to-rename-files-in-linux\/\" target=\"_blank\" rel=\"noopener\"><em>How to Rename Files in Linux<\/em><\/a> \u2013 Master File Management with Our Easy-to-Follow Tutorial!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux is a multi\u2011user operating system, which means several people can be logged in at the same time locally, remotely, or through different terminals. As a system administrator, knowing how&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[837],"tags":[1702],"class_list":["post-15212","post","type-post","status-publish","format-standard","hentry","category-tutorial","tag-linux-logged-in-users"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Check How Many Users Are Logged In on Linux<\/title>\n<meta name=\"description\" content=\"Learn simple ways to check how many users are logged in on Linux using built\u2011in commands like who, w, and users, along with easy methods.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Check How Many Users Are Logged In on Linux\" \/>\n<meta property=\"og:description\" content=\"Learn simple ways to check how many users are logged in on Linux using built\u2011in commands like who, w, and users, along with easy methods.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-05T12:06:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-05T12:31:36+00:00\" \/>\n<meta name=\"author\" content=\"Paul Lopez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Lopez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/check-logged-in-users-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/check-logged-in-users-linux\\\/\"},\"author\":{\"name\":\"Paul Lopez\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/566ccff9a2fae4af852be8097b179813\"},\"headline\":\"How to Check How Many Users Are Logged In on Linux\",\"datePublished\":\"2026-03-05T12:06:35+00:00\",\"dateModified\":\"2026-03-05T12:31:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/check-logged-in-users-linux\\\/\"},\"wordCount\":498,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"linux logged in users\"],\"articleSection\":[\"Tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/check-logged-in-users-linux\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/check-logged-in-users-linux\\\/\",\"name\":\"How to Check How Many Users Are Logged In on Linux\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2026-03-05T12:06:35+00:00\",\"dateModified\":\"2026-03-05T12:31:36+00:00\",\"description\":\"Learn simple ways to check how many users are logged in on Linux using built\u2011in commands like who, w, and users, along with easy methods.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/check-logged-in-users-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/check-logged-in-users-linux\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/check-logged-in-users-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tutorial\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Check How Many Users Are Logged In on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/566ccff9a2fae4af852be8097b179813\",\"name\":\"Paul Lopez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"caption\":\"Paul Lopez\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/paullopez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Check How Many Users Are Logged In on Linux","description":"Learn simple ways to check how many users are logged in on Linux using built\u2011in commands like who, w, and users, along with easy methods.","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:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Check How Many Users Are Logged In on Linux","og_description":"Learn simple ways to check how many users are logged in on Linux using built\u2011in commands like who, w, and users, along with easy methods.","og_url":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2026-03-05T12:06:35+00:00","article_modified_time":"2026-03-05T12:31:36+00:00","author":"Paul Lopez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Paul Lopez","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/"},"author":{"name":"Paul Lopez","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/566ccff9a2fae4af852be8097b179813"},"headline":"How to Check How Many Users Are Logged In on Linux","datePublished":"2026-03-05T12:06:35+00:00","dateModified":"2026-03-05T12:31:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/"},"wordCount":498,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["linux logged in users"],"articleSection":["Tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/","url":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/","name":"How to Check How Many Users Are Logged In on Linux","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2026-03-05T12:06:35+00:00","dateModified":"2026-03-05T12:31:36+00:00","description":"Learn simple ways to check how many users are logged in on Linux using built\u2011in commands like who, w, and users, along with easy methods.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/check-logged-in-users-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Tutorial","item":"https:\/\/www.bodhost.com\/kb\/category\/tutorial\/"},{"@type":"ListItem","position":2,"name":"How to Check How Many Users Are Logged In on Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/566ccff9a2fae4af852be8097b179813","name":"Paul Lopez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","caption":"Paul Lopez"},"url":"https:\/\/www.bodhost.com\/kb\/author\/paullopez\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/15212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=15212"}],"version-history":[{"count":18,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/15212\/revisions"}],"predecessor-version":[{"id":15230,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/15212\/revisions\/15230"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=15212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=15212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=15212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}