{"id":79767,"date":"2023-10-30T23:55:24","date_gmt":"2023-10-31T03:55:24","guid":{"rendered":"https:\/\/www.engineersgarage.com\/?p=79767"},"modified":"2023-10-29T15:06:09","modified_gmt":"2023-10-29T19:06:09","slug":"list-users-raspberry-pi","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/","title":{"rendered":"How do you list Raspberry Pi&#8217;s users?"},"content":{"rendered":"<p><span data-preserver-spaces=\"true\">Raspberry Pi (RPi) is a popular microcomputer used for embedded systems design, hosting high-level applications that run over an operating system. Many of these applications have multiple active users with different permissions and access to system resources.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">As a result, there may be situations when it\u2019s important to know what users are sharing the device. Fortunately, there are several ways to get a list of RPi\u2019s registered users on the Linux system.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In this article, we\u2019ll discuss some of the common methods to obtain a list of RPi users.\u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Listing users on Raspberry Pi<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">There are multiple methods for listing users on RPi, including the following.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\"><strong>1.<\/strong> Using the &#8216;cat&#8217; command<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>2.<\/strong> Using the &#8216;getent&#8217; command<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>3.<\/strong> Using the &#8216;cut&#8217; and &#8216;awk&#8217; commands<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>4.<\/strong> Using the &#8216;id&#8217; command<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>5.<\/strong> Using the &#8216;w&#8217; or &#8216;who&#8217; command<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>6.<\/strong> Using the &#8216;\/etc\/passwd&#8217; file<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>7.<\/strong> Using lslogin command<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>8.<\/strong> Using the &#8216;cut&#8217; command for group members<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>9.<\/strong> Using GUI<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Using the &#8216;cat&#8217; command<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">The cat command in RPi and other Linux or Unix-based operating systems is a basic utility that displays the contents of one or more text files on the terminal. Cat stands for concatenate, one of its primary functions. The command has this syntax:\u00a0<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>cat [options] [file(s)]<\/strong><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The command can read data from a \u201cpasswd\u201d file to obtain information about RPi\u2019s users. The passwd file is present in all the Linux-based systems, including Raspberry Pi. It contains information about all users with access to the system.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The following command can be used to attain the users:\u00a0<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>$ cat \/etc\/passwd<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-01.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79768 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-01-300x117.png\" alt=\"\" width=\"754\" height=\"294\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-01-300x117.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-01-368x144.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-01.png 640w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/a><\/p>\n<p>The command can be modified to obtain information about the users placed in the home directory by adding a filter using the &#8216;grep&#8217; and &#8216;cat&#8217; commands.<\/p>\n<p>The grep command in RPi and other Linux\/Unix-based operating systems is a powerful text-search utility used to search for specific patterns or strings within text files or the output of other commands. Grep stands for Global Regular Expression Print, which reflects its primary function of searching and printing lines that match a specified pattern.<\/p>\n<p>The &#8216;cat&#8217; and &#8216;grep&#8217; commands can list the users of the home directory as follows:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ cat \/etc\/passwd | grep home<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-02.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79769 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-02-300x75.png\" alt=\"\" width=\"752\" height=\"188\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-02-300x75.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-02-368x93.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-02.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Using the &#8216;getent&#8217; command<br \/>\n<\/span><\/strong><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\">The &#8216;getent&#8217; command is another way to obtain information about RPi\u2019s users. This command is a versatile utility that queries and retrieves information from various administrative databases. It can retrieve information about users, groups, hosts, networks, and other system-related data. It\u2019s also particularly useful for getting data managed by database sources specified in the &#8216;\/etc\/nsswitch.conf&#8217; configuration file.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">It has this syntax:<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>getent database [key]<\/strong><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The database specifies the type of retrieval information available (e.g., the \u201cpasswd\u201d for the user information, the group for group information, the host for the host information, etc.). The key is an optional parameter that can search for a specific entry within the database.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">To get a list of RPi\u2019s users, use the &#8216;getent&#8217; and &#8216;awk&#8217; commands as per below.<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>$ getent passwd | awk -F &#8216;:&#8217; &#8216;{print $1}&#8217;<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-03.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79770 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-03-300x168.png\" alt=\"\" width=\"752\" height=\"421\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-03-300x168.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-03-368x206.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-03.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p>To obtain information about a specific user, use this command:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ getent passwd &lt;username&gt;<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-04.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79771 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-04-300x134.png\" alt=\"\" width=\"752\" height=\"336\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-04-300x134.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-04-368x164.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-04.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p>This command can also be used to sort a list of users within a specific range when it&#8217;s used with the &#8216;awk&#8217; command as follows:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ getent passwd {1000..6000}<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-05.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79776 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-05-300x75.png\" alt=\"\" width=\"752\" height=\"188\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-05-300x75.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-05-368x91.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-05.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Using the &#8216;cut&#8217; and &#8216;awk&#8217; commands<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">The \u2018cut\u2019 command in RPi and other Linux\/Unix-based operating systems is a text-processing utility used to extract specific columns or fields from lines of text or delimited files. It\u2019s useful for manipulating and processing structured data. This command can separate text into columns based on a delimiter character and then select specific columns for output. It has this syntax:\u00a0<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>cut [options] [file(s)]<\/strong><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The \u2018[options]\u2019 are the optional flags that modify the behavior of the \u2018cut\u2019 command, including specifying the delimiter and selecting fields and \u2018[file(s)].\u2019 The \u2018[file(s)]\u2019 are the files from which the \u2018cut\u2019 command will read data.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">To obtain information about RPi\u2019s users, the command can be used to extract information from the \u2018passwd\u2019 file as follows:<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>$ cut -d: -f1 \/etc\/passwd<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-06.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79773 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-06-300x119.png\" alt=\"\" width=\"754\" height=\"299\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-06-300x119.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-06-368x145.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-06.png 640w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/a><\/p>\n<p>The \u2018awk\u2019 command in RPi and other Unix-like operating systems is a versatile text-processing utility that allows you to process and manipulate text data in a highly flexible and programmable manner. This command is powerful when working with structured text files, such as CSV files, log files, and other tabular or delimited data. The command has this syntax:<\/p>\n<p><span style=\"color: #800000;\"><strong>awk [options] &#8216;program&#8217; [file(s)]<\/strong><\/span><\/p>\n<p>The \u2018[options]\u2019 are the optional flags that modify the behavior of the \u2018awk\u2019 command. The &#8216;program&#8217; is a series of \u2018awk\u2019 commands enclosed in single quotes that define the actions to be performed on each line of input. The \u2018[file(s)]\u2019 are the files from which the \u2018awk\u2019 command will read data.<\/p>\n<p>To obtain information about RPi\u2019s users, this command can be used to extract information from the \u2018passwd\u2019 file as follows:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ awk -F: &#8216;{print $1}&#8217; \/etc\/passwd<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-07.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79775 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-07-300x118.png\" alt=\"\" width=\"752\" height=\"296\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-07-300x118.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-07-368x145.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-07.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Using the &#8216;id&#8217; command<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">The \u2018id\u2019 command in Raspberry Pi and other Unix-like operating systems displays information about a user or group, including their user and group IDs (UID and GID), supplementary group IDs, and further details related to the user or group&#8217;s identity and privileges.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">This command can help you quickly access information about the current user or a specific user or group on the system. The command has this syntax:\u00a0<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>id [options] [username]<\/strong><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The \u2018[options]\u2019 are the optional flags that modify the behavior of the \u2018id\u2019 command. The \u2018[username]\u2019 is an optional argument specifying the username you want to display. If this is not specified, it defaults to the current user. The command can be used to get information about a specific RPi user as follows:<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>$ id &lt;username&gt;<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-08.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79774 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-08-300x91.png\" alt=\"\" width=\"752\" height=\"228\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-08-300x91.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-08-368x112.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-08.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p><strong>Using the &#8216;w&#8217; or &#8216;who&#8217; commands<br \/>\n<\/strong>The \u2018w\u2019 command in Raspberry Pi and other Unix-like operating systems displays information about currently logged-in users and their activities. It provides a summary of who\u2019s logged into the system, what they\u2019re doing, and where they\u2019re connected from. This command is useful for system administrators to monitor user sessions and resource use. The command has this syntax:<\/p>\n<p><span style=\"color: #800000;\"><strong>w [options]<\/strong><\/span><\/p>\n<p>The \u2018 [options]\u2019 are the optional flags that modify the behavior of the \u2018w\u2019 command. It\u2019s executed as follows:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ w<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-09.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79772 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-09-300x73.png\" alt=\"\" width=\"753\" height=\"183\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-09-300x73.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-09-368x89.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-09.png 640w\" sizes=\"auto, (max-width: 753px) 100vw, 753px\" \/><\/a>The \u2018who\u2019 command in Raspberry Pi and other Unix-like operating systems displays information about currently logged-in users. It provides a summary of who\u2019s logged into the system, including details about their login sessions \u2014 such as the username, terminal or pseudo-terminal, login time, and remote IP address or hostname (if applicable).<\/p>\n<p>While the \u2018w\u2019 command provides detailed information, including the terminal they are using, the \u2018who\u2019 command offers a simpler list. It has this syntax:<\/p>\n<p><span style=\"color: #800000;\"><strong>who [options]<\/strong><\/span><\/p>\n<p>The \u2018 [options]\u2019 are the optional flags that modify the behavior of the \u2018who\u2019 command. It\u2019s executed as follows:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ who<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79778 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-10-300x76.png\" alt=\"\" width=\"751\" height=\"190\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-10-300x76.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-10-368x94.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-10.png 640w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/a><\/p>\n<p><strong>Using the \/etc\/passwd file<br \/>\n<\/strong>The information about RPi\u2019s users can also be obtained by directly accessing the \u2018passwd\u2019 file using a text editor or pager like &#8216;nano&#8217; or &#8216;less.&#8217; It can be accessed as follows:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ nano \/etc\/passwd<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-11.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79779 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-11-300x71.png\" alt=\"\" width=\"752\" height=\"178\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-11-300x71.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-11-368x87.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-11.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p>The &#8216;passwd&#8217; file can be accessed using the less pager as follows:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ less \/etc\/passwd<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-12.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79777 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-12-300x112.png\" alt=\"\" width=\"752\" height=\"281\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-12-300x112.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-12-368x137.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-12.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p><strong>Using the \u2018lslogin\u2019 command<br \/>\n<\/strong>The \u2018lslogin\u2019 command lists all of RPi or any other Linux-based system\u2019s current login sessions. It can be used to get information about the users who are logged in, the terminals they\u2019re using, and the time they log in.<\/p>\n<p>To list the current login sessions on your RPi, type the following command:<\/p>\n<p><span style=\"color: #800000;\"><strong>$ lslogin -u<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-13.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79781 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-13-300x128.png\" alt=\"\" width=\"752\" height=\"321\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-13-300x128.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-13-368x158.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-13.png 640w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/a><\/p>\n<p><strong>Using the &#8216;cut&#8217; command for group members<br \/>\n<\/strong>To list users belonging to a specific group, use the \u2018cut\u2019 and \u2018grep\u2019 commands as follows:<\/p>\n<p>grep &#8216;^&lt;groupname&gt;:&#8217; \/etc\/group | cut -d: -f4<\/p>\n<p><strong>Using GUI<br \/>\n<\/strong>In the desktop mode, a list of RPi users can be found by opening the file manager and navigating to the &#8216;home&#8217; folder. In this folder, there are additional folders of all of the RPi\u2019s users.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-14.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-79780 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-14-300x97.png\" alt=\"\" width=\"751\" height=\"243\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-14-300x97.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-14-368x119.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/TCH120-14.png 640w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/a><\/p>\n<p><strong>Conclusion<br \/>\n<\/strong>There are multiple ways to get information about Raspberry Pi\u2019s users. Most of these methods access the \u2018passwd\u2019 file and manipulate its content. For example, information about users who are currently logged in can be obtained through commands like &#8216;w,&#8217; &#8216;who,&#8217; and &#8216;lslogins&#8217;. A folder for each user is in RPi\u2019s home directory, which includes the names of all of the users.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi (RPi) is a popular microcomputer used for embedded systems design, hosting high-level applications that run over an operating system. Many of these applications have multiple active users with different permissions and access to system resources.\u00a0 As a result, there may be situations when it\u2019s important to know what users are sharing the device.&hellip;<\/p>\n","protected":false},"author":387,"featured_media":79783,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[13,3993,9],"tags":[1724,3309,4286],"class_list":{"2":"type-post","13":"entry","14":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How do you list Raspberry Pi&#039;s users?<\/title>\n<meta name=\"description\" content=\"How to get information about Raspberry Pi&#039;s users.\" \/>\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.engineersgarage.com\/list-users-raspberry-pi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How do you list Raspberry Pi&#039;s users?\" \/>\n<meta property=\"og:description\" content=\"How to get information about Raspberry Pi&#039;s users.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"507\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nikhil Agnihotri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikhil Agnihotri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/\"},\"author\":{\"name\":\"Nikhil Agnihotri\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\"},\"headline\":\"How do you list Raspberry Pi&#8217;s users?\",\"datePublished\":\"2023-10-31T03:55:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/\"},\"wordCount\":1390,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png\",\"keywords\":[\"raspberrypi\",\"rpi\",\"users\"],\"articleSection\":[\"Electronic Projects\",\"Raspberry pi\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/\",\"url\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/\",\"name\":\"How do you list Raspberry Pi's users?\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png\",\"datePublished\":\"2023-10-31T03:55:24+00:00\",\"description\":\"How to get information about Raspberry Pi's users.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png\",\"width\":800,\"height\":507},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How do you list Raspberry Pi&#8217;s users?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\",\"name\":\"Nikhil Agnihotri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"caption\":\"Nikhil Agnihotri\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How do you list Raspberry Pi's users?","description":"How to get information about Raspberry Pi's users.","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.engineersgarage.com\/list-users-raspberry-pi\/","og_locale":"en_US","og_type":"article","og_title":"How do you list Raspberry Pi's users?","og_description":"How to get information about Raspberry Pi's users.","og_url":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":800,"height":507,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png","type":"image\/png"}],"author":"Nikhil Agnihotri","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"Nikhil Agnihotri","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/"},"author":{"name":"Nikhil Agnihotri","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6"},"headline":"How do you list Raspberry Pi&#8217;s users?","datePublished":"2023-10-31T03:55:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/"},"wordCount":1390,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png","keywords":["raspberrypi","rpi","users"],"articleSection":["Electronic Projects","Raspberry pi","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/","url":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/","name":"How do you list Raspberry Pi's users?","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png","datePublished":"2023-10-31T03:55:24+00:00","description":"How to get information about Raspberry Pi's users.","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator.png","width":800,"height":507},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/list-users-raspberry-pi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"How do you list Raspberry Pi&#8217;s users?"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6","name":"Nikhil Agnihotri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","caption":"Nikhil Agnihotri"},"url":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator-600x400.png","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2023\/10\/RPi-users-rotator-600x507.png","author_info":{"display_name":"Nikhil Agnihotri","author_link":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/79767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/387"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=79767"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/79767\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/79783"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=79767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=79767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=79767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}