Sunday, 7 January 2018


User Commands

To find the lists of users in the Linux and to find on which group the user belongs to.
#cat /etc/passwd
The below output lists all the users and the user who has currently logged in to the system.

Group Commands
To lists all the groups and on which group’s the users belong to.
#cat /etc/group
#groups ec2-user

id Command
id is a tool which is used to find the user id and group id of the users in the system.
#id ec2-user

Finger is a command line utility to get the complete detail about the user in the Linux, The details include users’ real name, shell, home directory etc.,
To get this feature We need to install finger command using the command:
#yum install finger -y
The below output shows the user’s Login name, Shell type, Home directory, Time of Login etc.,

grep Command
grep is a pattern searching tool available in all the Linux systems.
If you want to find the specific information, You can use grep to filter according to our need.
#cat /etc/passwd |grep ec2-user
#rpm -qa |grep finger
To filter the specific user info or the particular rpm in the Linux.

lslogins Command
To lists only the know users in the Linux system.
From user id 1-999 It is reserved for system users.The users we create starts with uid 1000. Those users are referred as known users.
#lslogins -u
-u flag is used to list only the known user accounts.

login Command
who command is used to find the users who are logged in to the system and the terminals they are connecting from.
w command is used to lists all the logged in users and the what they are doing.
last (or) last -a command is used to list the last logged in users information.

#last [or] last -a

No comments:

How to Download and Install RHEL8 Beta For Free (Red Hat Enterprise Linux)

RHEL (Red Hat Enterprise Linux) 8 beta was released on November 14, 2018, 4 years after the release of RHEL 7. This tutorial will be showi...