+5 votes
62 views
View Linux System Users

in Linux/Unix by (552k points)
reopened | 62 views

1 Answer

+3 votes
Best answer

How to see system users in Linux

When we administer Linux systems it is necessary that we have knowledge of various options to access the list of users and groups in the system, this allows us to have precise control to know what type of permissions to assign, what users to create or delegate permissions and at the level of groups we can create and manage groups for specific tasks, TechnoWikis will explain how to see users and groups in Linux..

 

The ability to view Linux system users using commands provides comprehensive and detailed information on account activity and configuration on a Linux system. These commands that we are going to see today provide important information for system administrators, being able to get hold of information related to users and groups in Linux quickly. We are going to see Linux System Users using different interesting commands.

 

 

 

To stay up to date, remember to subscribe to our YouTube channel!
SUBSCRIBE ON YOUTUBE

 

 

How to see system users in Linux


To have access to the users we will take the data from the /etc/passwd route, this is a file where the information that is necessary during the login in Linux is stored, in this file we will see the list of current system accounts and it gives us details to manage such as user ID, group ID, home directory, shell and more useful administration options.

 

Step 1

We open the terminal and we will execute the following command:
 less /etc/passwd 
image

 

Step 2

By pressing Enter we will see all the registered users in the /etc/passwd file:

 

image

 

Step 3

Each line is divided into fields and, in turn, we can see these fields delimited by the colon character ( image , to exit the results press the q key.

 

It is possible to generate the results without having access to all the details of the /etc/passwd file, in this case we will use the cut command and the -d parameter to split the results into colon delimiters as follows:

 cut -d : -f 1 /etc/passwd 
Step 4

There we see only the users without the other details.

 

 

 

image

 

 

step 5

Now if we want to see the current groups registered in the system, we execute the following:
 less /etc/group 
image

 

step 6

By pressing Enter we will see all the groups together with their details. To exit the results, press the q key.

 

image

 

step 7

In /etc/group we find the group information or the user groups are defined there, we see how all the fields are separated by colons ( . As in the image previous command, it will only be possible to access the group details by executing:
 cut -d : -f 1 /etc/group 
image

 

step 8

If we need to see the connected users we execute the letter “w”, this will list additional details of each user:

 

image

 

step 9

In addition to this command, it is possible to use “who” to have summarized results of the users connected to the session:

 

image

 

We see how listing system users in Linux is a simple but effective management task..

 


by (3.5m points)
edited

Related questions

+4 votes
1 answer
asked Nov 11, 2022 in Linux/Unix by backtothefuture (552k points) | 62 views
+3 votes
1 answer
asked Feb 17, 2020 in Linux / Unix by backtothefuture (552k points) | 306 views
+5 votes
1 answer
asked Aug 22, 2023 in Linux/Unix by backtothefuture (552k points) | 55 views
+3 votes
1 answer
+4 votes
1 answer
asked Oct 14, 2019 in Linux / Unix by backtothefuture (552k points) | 273 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users