1
00:00:00,730 --> 00:00:03,310
Hello and welcome back to this lesson.

2
00:00:03,670 --> 00:00:10,600
So in this video, we're going to see some of the user information and management commands that are

3
00:00:10,600 --> 00:00:13,060
used in Linux operating system.

4
00:00:13,630 --> 00:00:14,080
All right.

5
00:00:14,080 --> 00:00:18,190
To begin with, the first command that we are going to see is the ID command.

6
00:00:18,670 --> 00:00:23,950
Now, this command displays the user and group IDs of your current user.

7
00:00:24,100 --> 00:00:28,030
Let us see the output and you can see the user ID is root.

8
00:00:28,060 --> 00:00:32,410
Group ID is root and the groups into this computer is root.

9
00:00:32,770 --> 00:00:38,740
Now, if you are logged in with another user, you will be able to see a different user ID, a different

10
00:00:38,740 --> 00:00:41,260
group ID and different set of groups.

11
00:00:42,160 --> 00:00:44,050
All right, let's move ahead.

12
00:00:44,410 --> 00:00:48,100
Now, the second command is the command, which is last.

13
00:00:48,310 --> 00:00:52,750
So you just have to write last and hit enter this command display.

14
00:00:52,780 --> 00:01:00,730
The last users who have logged in into the system and you can see the name of the users here, the user

15
00:01:00,730 --> 00:01:01,480
is root.

16
00:01:01,600 --> 00:01:03,820
After that, it was a system reboot.

17
00:01:04,330 --> 00:01:07,840
The user admin has also logged in into this computer.

18
00:01:07,870 --> 00:01:13,730
Similarly, you can see the different users that have logged in into this computer.

19
00:01:13,750 --> 00:01:22,690
Here is a user which is wolf, admin, root, etc. So by typing the command last you are able to see

20
00:01:22,690 --> 00:01:26,500
the last users who have logged in into the operating system.

21
00:01:27,280 --> 00:01:27,970
Perfect.

22
00:01:28,300 --> 00:01:34,660
Now, in case you want to see who is logged in currently into the system, you can simply type the command

23
00:01:34,660 --> 00:01:36,550
who and hit enter.

24
00:01:36,700 --> 00:01:41,680
And you can see we are logged in with the current user which is root.

25
00:01:42,490 --> 00:01:43,090
Perfect.

26
00:01:43,750 --> 00:01:44,740
Moving ahead.

27
00:01:45,280 --> 00:01:52,270
If you want to show who is logged in and what they are doing currently, you can simply type W and you

28
00:01:52,270 --> 00:01:57,380
can see the current user which is logged in as a root as you can see.

29
00:01:57,400 --> 00:02:02,740
Log in, idle CPU, CPU and what they are currently doing.

30
00:02:02,890 --> 00:02:08,440
So this command displays the current logged in user and the task that has been performed.

31
00:02:09,330 --> 00:02:13,530
Now in case you want to create a group.

32
00:02:13,530 --> 00:02:17,730
So let's see that how you can create a group or a user.

33
00:02:18,030 --> 00:02:26,580
So let me just clear the screen and let's say we make a new group that is group ADD and the group name

34
00:02:26,580 --> 00:02:27,900
is Test.

35
00:02:29,320 --> 00:02:33,790
Now when I hit enter, a group has been successfully created.

36
00:02:34,180 --> 00:02:43,960
Now let's say we want to add a user with a comment of John Smith and let's create the user's home directory

37
00:02:43,960 --> 00:02:44,670
as well.

38
00:02:44,680 --> 00:02:47,350
So for that we are going to add a user.

39
00:02:47,350 --> 00:02:55,390
So the command is user add hyphen C and let's give it a name as John Smith.

40
00:02:56,870 --> 00:03:01,640
And hyphen M and let's type it as John.

41
00:03:02,990 --> 00:03:07,680
And when I hit enter you can see it says the user.

42
00:03:07,700 --> 00:03:09,930
John already exists.

43
00:03:09,950 --> 00:03:12,330
All right, so let's delete the user for that.

44
00:03:12,350 --> 00:03:19,060
You need to type the command, which is user DEL, which means delete and the name of the user.

45
00:03:19,250 --> 00:03:20,960
So now it's deleted.

46
00:03:21,140 --> 00:03:27,350
Now let's execute this command again and you can see the user has been added successfully.

47
00:03:27,560 --> 00:03:31,940
Now, how to verify if the user has successfully been added.

48
00:03:32,030 --> 00:03:34,460
Simply go to this directory.

49
00:03:34,460 --> 00:03:35,120
Which is.

50
00:03:35,830 --> 00:03:44,440
Cat slash Etsy slash pass WD and hit enter and you can see the latest user which has been successfully

51
00:03:44,440 --> 00:03:53,950
added is John and you can see over here this is the directory of John and home slash.

52
00:03:55,020 --> 00:03:57,630
Here is John.

53
00:03:58,140 --> 00:04:02,940
These are the other users which have been added into this computer.

54
00:04:03,330 --> 00:04:05,940
So now we saw how to add a user.

55
00:04:06,120 --> 00:04:08,610
We saw how to delete a user.

56
00:04:08,970 --> 00:04:12,660
We also saw how to create a group of that user.

57
00:04:12,870 --> 00:04:20,720
Now let's add John account to a specific group, which is suppose sales group.

58
00:04:20,730 --> 00:04:24,480
So for that, we are going to write this command.

59
00:04:24,780 --> 00:04:35,130
Let me just clear the screen, which is user mod, user modify, modify the group to sales of the user,

60
00:04:35,130 --> 00:04:36,570
which is John.

61
00:04:36,990 --> 00:04:40,980
And you can see it says group sales does not exist.

62
00:04:40,980 --> 00:04:43,860
So we have created a group that was test.

63
00:04:43,860 --> 00:04:50,700
So let's see if you are able to add this user to a group which is test and it looks perfect.

64
00:04:50,970 --> 00:04:54,450
Now let us see the user details, which is.

65
00:04:55,950 --> 00:04:59,990
And slash etsy slash pass w rd.

66
00:05:00,000 --> 00:05:05,790
And here you can see the user which is John and the details about it.

67
00:05:05,820 --> 00:05:10,230
Now let's quickly switch the user to John.

68
00:05:10,920 --> 00:05:16,410
So switch user John and now I'm switched to the user, which is John.

69
00:05:16,530 --> 00:05:19,420
Let's verify using the command, which is who am I?

70
00:05:19,440 --> 00:05:24,060
And you can see the current logged in user is John.

71
00:05:24,090 --> 00:05:27,510
Let us type the command ID and an ID.

72
00:05:27,540 --> 00:05:34,220
You can see the user ID is John, the group ID is John and the groups which the user has been added

73
00:05:34,230 --> 00:05:35,280
is test.

74
00:05:35,640 --> 00:05:37,430
I hope you guys understood this.

75
00:05:37,440 --> 00:05:45,270
This is very, very simple yet very important to know how you can add a user, delete a user, and add

76
00:05:45,270 --> 00:05:47,910
that user to a specific group.

77
00:05:48,030 --> 00:05:48,780
Thank you.
