WEBVTT - This file was automatically generated by VIMEO

0
00:00:13.500 --> 00:00:17.600
Hello and welcome back to this lesson. So

1
00:00:16.600 --> 00:00:19.100
 in this video we are

2
00:00:19.100 --> 00:00:23.400
 going to see some of the user information and management commands

3
00:00:22.400 --> 00:00:25.900
 that are used in Linux operating

4
00:00:25.900 --> 00:00:26.200
 system.

5
00:00:27.200 --> 00:00:30.600
Alright to begin with the First Command that we are going to see is

6
00:00:30.600 --> 00:00:31.600
 the ID command.

7
00:00:32.300 --> 00:00:35.500
Now this command displays the user and group

8
00:00:35.500 --> 00:00:38.200
 IDs of your current user. Let us see

9
00:00:38.200 --> 00:00:41.400
 the output and you can see the user ID is root

10
00:00:41.400 --> 00:00:44.700
 group ID is root and the groups into this

11
00:00:44.700 --> 00:00:47.500
 computer is route. Now if you

12
00:00:47.500 --> 00:00:50.500
 are logged in with another user you will be able to see a

13
00:00:50.500 --> 00:00:53.600
 different user ID a different group ID and different

14
00:00:53.600 --> 00:00:54.400
 set of groups.

15
00:00:55.700 --> 00:00:57.300
Alright, let's move ahead.

16
00:00:58.100 --> 00:01:02.200
Now the second command is the command which is last so

17
00:01:01.200 --> 00:01:04.400
 you just have to write last and hit enter

18
00:01:04.400 --> 00:01:08.100
 this command display the last users who

19
00:01:07.100 --> 00:01:09.300
 have logged in into the system.

20
00:01:10.100 --> 00:01:14.100
And you can see the name of the users here. The

21
00:01:13.100 --> 00:01:16.200
 user is root after that. It was

22
00:01:16.200 --> 00:01:17.200
 a system reboot.

23
00:01:17.900 --> 00:01:20.300
The user admin has also logged in

24
00:01:20.300 --> 00:01:23.400
 into this computer. Similarly. You can see the different

25
00:01:23.400 --> 00:01:24.700
 uses that have

26
00:01:25.800 --> 00:01:28.600
logged into this computer here is a user

27
00:01:28.600 --> 00:01:29.300
 which is Wolf.

28
00:01:30.600 --> 00:01:34.000
Admin root Etc. So by

29
00:01:33.100 --> 00:01:36.000
 typing the command last you are able to

30
00:01:36.100 --> 00:01:39.700
 see the last uses who have logged in into the operating system.

31
00:01:40.900 --> 00:01:41.300
Perfect.

32
00:01:41.900 --> 00:01:44.400
Now in case you want to see who is

33
00:01:44.400 --> 00:01:47.100
 logged in currently into the system, you can

34
00:01:47.100 --> 00:01:50.900
 simply type the command who and hit enter and you

35
00:01:50.900 --> 00:01:53.200
 can see we are logged in with the current

36
00:01:53.200 --> 00:01:54.900
 user which is root.

37
00:01:56.100 --> 00:01:56.400
Perfect.

38
00:01:57.300 --> 00:01:58.100
moving ahead

39
00:01:58.900 --> 00:02:01.400
If you want to show who is logged in

40
00:02:01.400 --> 00:02:04.300
 and what they are doing currently you can simply

41
00:02:04.300 --> 00:02:07.400
 type w and you can see the current user

42
00:02:07.400 --> 00:02:10.300
 which is logged in is root as you

43
00:02:10.300 --> 00:02:14.400
 can see login idle jcpu pcpu

44
00:02:13.400 --> 00:02:15.900
 and what they are currently doing.

45
00:02:16.700 --> 00:02:19.800
So this command displays the current login user and

46
00:02:19.800 --> 00:02:21.800
 the task that has been performed.

47
00:02:22.900 --> 00:02:25.100
Now in case you want to

48
00:02:25.100 --> 00:02:28.300
 create a group, so let's see that

49
00:02:28.300 --> 00:02:31.200
 how you can create a group or a user.

50
00:02:31.700 --> 00:02:34.500
So let me just clear the screen and let's

51
00:02:34.500 --> 00:02:38.000
 say we make a new group that is group

52
00:02:37.600 --> 00:02:40.300
 AD and the group name is

53
00:02:40.300 --> 00:02:41.100
 test.

54
00:02:42.900 --> 00:02:45.400
Now when I hit enter a group has been

55
00:02:45.400 --> 00:02:47.100
 successfully created.

56
00:02:47.900 --> 00:02:50.500
Now, let's say we want to add a

57
00:02:50.500 --> 00:02:51.000
 user.

58
00:02:51.700 --> 00:02:54.900
With a comment of John Smith and

59
00:02:54.900 --> 00:02:57.600
 let's create the user's home directory

60
00:02:57.600 --> 00:03:00.500
 as well. So for that we are going to add a

61
00:03:00.500 --> 00:03:03.500
 user. So the command is user add -

62
00:03:03.500 --> 00:03:06.500
 c and let's give

63
00:03:06.500 --> 00:03:08.700
 it a name as John Smith.

64
00:03:10.500 --> 00:03:13.600
And hyphen M and let's

65
00:03:13.600 --> 00:03:14.800
 type it as John.

66
00:03:16.600 --> 00:03:19.800
And when I hit enter you can see it

67
00:03:19.800 --> 00:03:23.000
 says the user John already exists.

68
00:03:22.900 --> 00:03:25.400
 All right, so let's delete the user for

69
00:03:25.400 --> 00:03:28.500
 that. You need to type the command which is use a

70
00:03:28.500 --> 00:03:30.200
 Dell, which means delete.

71
00:03:30.800 --> 00:03:33.200
And the name of the user so now

72
00:03:33.200 --> 00:03:36.200
 it's deleted. Now. Let's execute this command

73
00:03:36.200 --> 00:03:40.600
 again and you can see the user has been added successfully

74
00:03:39.600 --> 00:03:42.600
 now how to verify

75
00:03:42.600 --> 00:03:46.100
 if the user has successfully been added simply

76
00:03:45.100 --> 00:03:48.400
 go to this directory, which is

77
00:03:49.400 --> 00:03:53.100
Cat / EDC slash past

78
00:03:52.100 --> 00:03:55.100
 WD and hit enter and you can

79
00:03:55.100 --> 00:03:58.800
 see the latest user which has been successfully added is

80
00:03:58.800 --> 00:04:01.200
 John and you can

81
00:04:01.200 --> 00:04:02.000
 see over here.

82
00:04:02.800 --> 00:04:06.300
This is the directory of John in home

83
00:04:05.300 --> 00:04:07.000
 slash.

84
00:04:08.600 --> 00:04:10.800
Here is John.

85
00:04:11.800 --> 00:04:14.300
These are the other users which have been

86
00:04:14.300 --> 00:04:16.100
 added into this computer.

87
00:04:17.100 --> 00:04:19.300
So now we saw how to add a user.

88
00:04:19.800 --> 00:04:22.000
We saw how to delete a user.

89
00:04:22.600 --> 00:04:25.500
We also saw how to create a group of that

90
00:04:25.500 --> 00:04:28.600
 user. Now. Let's add John

91
00:04:28.600 --> 00:04:31.600
 account to a specific group, which is

92
00:04:32.400 --> 00:04:35.100
suppose Sales Group. So for that we are

93
00:04:35.100 --> 00:04:35.500
 going to

94
00:04:36.600 --> 00:04:39.600
Write this command. Let me just clear the

95
00:04:39.600 --> 00:04:43.300
 screen, which is user mod user modify.

96
00:04:44.500 --> 00:04:45.700
modify the group

97
00:04:46.500 --> 00:04:49.100
to sales of the user which is

98
00:04:49.100 --> 00:04:49.800
 John.

99
00:04:50.600 --> 00:04:53.700
And you can see it says group sales does not

100
00:04:53.700 --> 00:04:56.000
 exist. So we have created a group

101
00:04:56.300 --> 00:04:59.200
 that was test. So let's see if you are able

102
00:04:59.200 --> 00:05:02.800
 to add this user to a group which is test and

103
00:05:02.800 --> 00:05:05.600
 it looks perfect. Now, let us

104
00:05:05.600 --> 00:05:07.500
 see the user details, which is

105
00:05:09.500 --> 00:05:13.100
In slash Etc slash past

106
00:05:12.100 --> 00:05:15.500
 WD and here you can see the user

107
00:05:15.500 --> 00:05:16.800
 which is John.

108
00:05:17.700 --> 00:05:21.200
And the details about it now, let's quickly switch

109
00:05:20.200 --> 00:05:23.500
 the user to John.

110
00:05:24.600 --> 00:05:27.500
so switch user John and now I'm

111
00:05:27.500 --> 00:05:30.900
 switched to the user which is John Let's verify

112
00:05:30.900 --> 00:05:33.300
 using the command which is who am I and you

113
00:05:33.300 --> 00:05:33.600
 can see

114
00:05:34.800 --> 00:05:38.000
the current logged in user is John. Let

115
00:05:37.200 --> 00:05:40.900
 us type the command ID and in ID

116
00:05:40.900 --> 00:05:43.300
 you can see the user ID is

117
00:05:43.300 --> 00:05:46.300
 John the group ID is John and the groups which

118
00:05:46.300 --> 00:05:48.700
 the user has been added is test.

119
00:05:49.300 --> 00:05:52.300
I hope you guys understood this. This is very very simple

120
00:05:52.300 --> 00:05:55.700
 yet. Very important to know how you

121
00:05:55.700 --> 00:05:58.200
 can add a user delete a user

122
00:05:58.200 --> 00:06:01.900
 and add that user to a specific group. Thank

123
00:06:01.900 --> 00:06:01.900
 you.
