1 00:00:00,000 --> 00:00:02,040 [No audio] 2 00:00:02,040 --> 00:00:06,150 Processes and jobs. Before we get into 3 00:00:06,150 --> 00:00:08,550 this lesson, I want you to understand 4 00:00:08,880 --> 00:00:11,910 what exactly each term means in Linux 5 00:00:11,910 --> 00:00:14,610 environment. Well, first we have 6 00:00:14,640 --> 00:00:17,550 applications, which are also referred to 7 00:00:17,550 --> 00:00:21,300 as service. An application or a service 8 00:00:21,690 --> 00:00:24,510 is like a program that runs in your 9 00:00:24,510 --> 00:00:27,210 computer. And then application could be 10 00:00:27,240 --> 00:00:29,490 anything like in Windows, you have 11 00:00:29,490 --> 00:00:32,580 Microsoft Word, PowerPoint, and Linux, 12 00:00:32,580 --> 00:00:35,100 you have programs or applications like 13 00:00:35,100 --> 00:00:39,030 NTP, NFS, Apache, and whole bunch of 14 00:00:39,030 --> 00:00:41,460 different programs. So that is an 15 00:00:41,460 --> 00:00:44,340 application and service that runs on 16 00:00:44,340 --> 00:00:47,550 your computer. Then you have a script. 17 00:00:48,240 --> 00:00:52,200 What exactly a script is? A script is 18 00:00:52,290 --> 00:00:55,920 something that is written in a file, and 19 00:00:55,920 --> 00:01:00,450 then packaged it to in a way that it 20 00:01:00,450 --> 00:01:03,930 will execute. So any application that is 21 00:01:03,930 --> 00:01:06,150 running in your computer, for example, 22 00:01:06,150 --> 00:01:09,780 Apache, you would have to run that as a 23 00:01:09,780 --> 00:01:11,760 script. And that will run in the 24 00:01:11,760 --> 00:01:14,010 background. So that's actually a script. 25 00:01:14,280 --> 00:01:16,230 And also all those different commands 26 00:01:16,230 --> 00:01:18,120 that we run in our Linux environment, 27 00:01:18,150 --> 00:01:20,580 all of them are also referred to as 28 00:01:20,580 --> 00:01:24,870 scripts. Then we have a process. What is 29 00:01:24,870 --> 00:01:27,930 a process? When you run an application, 30 00:01:27,960 --> 00:01:31,020 or when you store up an application, it 31 00:01:31,020 --> 00:01:34,020 actually generates process, with it's 32 00:01:34,020 --> 00:01:37,350 process ID. Now processes could be one 33 00:01:37,440 --> 00:01:39,840 associated to that application, or it 34 00:01:39,840 --> 00:01:42,630 could be multiple processes. Then we 35 00:01:42,630 --> 00:01:46,710 have daemon. The daemon is, I could tell 36 00:01:46,710 --> 00:01:50,190 you when I compare it with a process, is 37 00:01:50,220 --> 00:01:53,580 something that continuously runs in the 38 00:01:53,580 --> 00:01:57,150 background, or it doesn't stops. So when 39 00:01:57,150 --> 00:01:58,950 you run a daemon, which is also a 40 00:01:58,950 --> 00:02:01,530 process, but it keeps on running in the 41 00:02:01,530 --> 00:02:04,260 background, and it keeps listening to 42 00:02:04,260 --> 00:02:05,970 the incoming traffic or outgoing 43 00:02:05,970 --> 00:02:09,449 traffic. Then there is a thread or 44 00:02:09,449 --> 00:02:13,020 threads. Every process could have 45 00:02:13,020 --> 00:02:16,290 multiple threads associated with it. An 46 00:02:16,290 --> 00:02:19,980 application that is running in your 47 00:02:19,980 --> 00:02:23,970 background, let's say NFS. When you run 48 00:02:24,000 --> 00:02:26,250 that application in your Linux machine, 49 00:02:26,640 --> 00:02:29,490 it could have many multiple threads. If 50 00:02:29,520 --> 00:02:31,350 a machine or remote machine tried to 51 00:02:31,350 --> 00:02:33,930 connect to you through NFS, it will 52 00:02:33,930 --> 00:02:36,330 generate one thread for it, and it will 53 00:02:36,330 --> 00:02:38,310 generate a second thread or third thread 54 00:02:38,310 --> 00:02:40,110 for other computers that are attaching 55 00:02:40,110 --> 00:02:44,700 to it. Then we have a job. A job is 56 00:02:44,700 --> 00:02:48,660 something that is created by scheduler, 57 00:02:48,960 --> 00:02:51,210 like a work order to run those 58 00:02:51,210 --> 00:02:56,010 applications and services. In process 59 00:02:56,040 --> 00:02:59,160 and service commands, we have a first 60 00:02:59,160 --> 00:03:04,260 command is systemctl. This command is 61 00:03:04,290 --> 00:03:07,620 now used in Redhat 7 and it is 62 00:03:07,620 --> 00:03:11,610 being replaced. Sorry, if the old 63 00:03:11,610 --> 00:03:13,830 command that was running an earlier 64 00:03:13,830 --> 00:03:16,830 version of Red Hat or CentOS service. 65 00:03:17,070 --> 00:03:19,320 service is now being replaced with a 66 00:03:19,320 --> 00:03:23,520 newer command systemctl. Then we have a 67 00:03:23,520 --> 00:03:27,450 ps command. This command allows you to 68 00:03:27,450 --> 00:03:30,570 see what are the processes running in 69 00:03:30,570 --> 00:03:32,910 your Linux system. You could use 70 00:03:32,940 --> 00:03:35,790 different options with that, to find out 71 00:03:35,790 --> 00:03:37,530 exactly the process that you are looking 72 00:03:37,530 --> 00:03:40,560 for. Then you have a top command. Now 73 00:03:40,560 --> 00:03:42,960 when you run the top command, you will 74 00:03:42,960 --> 00:03:44,850 see all your processes running in your 75 00:03:44,850 --> 00:03:47,640 system, depending on which process you 76 00:03:47,640 --> 00:03:51,060 want to see first, based on its load, 77 00:03:51,480 --> 00:03:53,610 and it also tells you some your memory 78 00:03:53,610 --> 00:03:55,770 information CPU information that is 79 00:03:55,770 --> 00:03:59,340 being used by that process. Then we have 80 00:03:59,340 --> 00:04:02,910 a kill command. The kill Command kills 81 00:04:02,940 --> 00:04:05,100 the process, it kills by the process 82 00:04:05,100 --> 00:04:08,340 name or kills by the process ID. 83 00:04:08,790 --> 00:04:11,760 So when you start an application, again 84 00:04:11,760 --> 00:04:13,890 going back to our example of Apache, 85 00:04:13,950 --> 00:04:17,370 when you run an application HTTP, which 86 00:04:17,370 --> 00:04:20,160 associated with Apache, it has a process 87 00:04:20,160 --> 00:04:23,220 ID to it. You could stop that process by 88 00:04:23,220 --> 00:04:27,420 running systemctl stop httpd, or you 89 00:04:27,420 --> 00:04:29,430 could simply kill followed by the 90 00:04:29,430 --> 00:04:32,100 process name or process ID. We'll cover 91 00:04:32,100 --> 00:04:35,220 kill command later in this lesson. Then 92 00:04:35,220 --> 00:04:38,430 we have crontab. crontab command is used 93 00:04:38,430 --> 00:04:41,760 to schedule these applications or 94 00:04:41,760 --> 00:04:43,860 these process or these services for you 95 00:04:43,860 --> 00:04:46,890 in your system. You will run crontab 96 00:04:46,890 --> 00:04:49,140 with minus e to edit it, and there are 97 00:04:49,140 --> 00:04:51,300 different options that we'll cover with 98 00:04:51,300 --> 00:04:54,090 the crontab. So when that crontab when 99 00:04:54,090 --> 00:04:57,990 that process or application is scheduled 100 00:04:58,020 --> 00:05:02,250 in crontab, that becomes a job. And the 101 00:05:02,250 --> 00:05:05,280 last command that we'll cover is at. at 102 00:05:05,280 --> 00:05:08,010 command is just like crontab. The only 103 00:05:08,010 --> 00:05:10,920 difference between at and crontab is, at 104 00:05:10,950 --> 00:05:17,461 is scheduled as a one time basis or as an ad hoc process. 105 00:05:17,461 --> 00:05:19,447 [No audio] 106 00:05:19,447 --> 00:05:21,330 We'll look into our Linux 107 00:05:21,330 --> 00:05:24,300 machine, and we'll go over the processes 108 00:05:24,300 --> 00:05:27,510 and some of those commands. Let's log 109 00:05:27,510 --> 00:05:35,520 in, clear our screen, cd, check where we 110 00:05:35,520 --> 00:05:39,240 are, who we are, and what is the hostname. 111 00:05:39,240 --> 00:05:44,670 Good. So do clear. All these commands 112 00:05:44,670 --> 00:05:47,580 that we will be running, most of these 113 00:05:47,580 --> 00:05:52,500 commands need root privileges. So we 114 00:05:52,500 --> 00:05:54,960 could either become root on this 115 00:05:55,290 --> 00:05:58,080 terminal or we could use a PuTTY terminal, 116 00:05:58,710 --> 00:06:00,630 whichever the terminal that you prefer. 117 00:06:00,780 --> 00:06:05,220 For this, we will stay on the console so become root. 118 00:06:05,220 --> 00:06:13,649 [No audio] 119 00:06:13,649 --> 00:06:19,670 Okay, let's clear this out. Now systemctl 120 00:06:19,670 --> 00:06:21,989 is the command to start an 121 00:06:22,019 --> 00:06:26,069 application or stop an application. It 122 00:06:26,069 --> 00:06:30,239 also is the command that is used to list 123 00:06:30,329 --> 00:06:32,999 or sorry to enable an application to 124 00:06:32,999 --> 00:06:36,389 start or stop at the boot time, meaning 125 00:06:36,419 --> 00:06:38,069 every time your computer starts up, 126 00:06:38,279 --> 00:06:41,909 you need certain applications to run. So 127 00:06:41,909 --> 00:06:45,119 to start an application, let's say I 128 00:06:45,119 --> 00:06:47,489 wanted to start an application called 129 00:06:47,519 --> 00:06:51,989 NTP. NTP, is a daemon that runs all the 130 00:06:51,989 --> 00:06:54,149 time, which stands for Network Time 131 00:06:54,149 --> 00:06:58,317 Protocol, which syncs your time to other clocks. 132 00:06:58,317 --> 00:07:05,559 [No audio] 133 00:07:05,559 --> 00:07:10,319 So systemctl restart ntpd. 134 00:07:10,319 --> 00:07:12,599 The d we are putting in because it's 135 00:07:12,599 --> 00:07:15,989 telling it it's a daemon. You hit enter, 136 00:07:17,339 --> 00:07:19,469 and you get your prompt back. The reason 137 00:07:19,469 --> 00:07:20,909 you get your prompt back is because it 138 00:07:20,909 --> 00:07:24,329 did start it that NTP service. Now how 139 00:07:24,329 --> 00:07:26,159 do we check if that service is running? 140 00:07:26,639 --> 00:07:30,179 You do ps and the option that I use my 141 00:07:30,179 --> 00:07:33,989 favorite is to have I open or dash ef, 142 00:07:34,289 --> 00:07:37,499 you could use other options. ps minus ef 143 00:07:37,499 --> 00:07:40,049 you hit enter. When you hit Enter, 144 00:07:40,049 --> 00:07:41,699 you're going to see all bunch of 145 00:07:41,699 --> 00:07:43,349 processes that are running in your 146 00:07:43,349 --> 00:07:45,659 system. Do you really want to look into 147 00:07:45,689 --> 00:07:48,569 all these processes? No, you are looking 148 00:07:48,569 --> 00:07:50,369 for only one process which you just 149 00:07:50,369 --> 00:07:53,669 started. So you do ps minus ef, pipe it, 150 00:07:54,149 --> 00:07:58,889 grep it, ntpd, and it will tell you 151 00:07:58,919 --> 00:08:01,679 yes, the process is running or the 152 00:08:01,709 --> 00:08:04,619 application is running. That's right 153 00:08:04,619 --> 00:08:07,049 here. You could also use the same 154 00:08:07,049 --> 00:08:11,639 command systemctl status command to 155 00:08:11,639 --> 00:08:14,609 view if the process is running. There it 156 00:08:14,609 --> 00:08:18,059 tells you right here, the Network Time 157 00:08:18,059 --> 00:08:21,929 Protocol, that's a service. And it's 158 00:08:21,929 --> 00:08:24,479 loaded and it's active and it's running. 159 00:08:26,009 --> 00:08:27,749 And it's running since the time and it 160 00:08:27,749 --> 00:08:29,939 gives you a lot of other details. 161 00:08:30,239 --> 00:08:33,539 Now what if you want it to stop this 162 00:08:33,539 --> 00:08:38,339 process, you could do systemctl stop 163 00:08:39,058 --> 00:08:44,279 ntpd, and it stopped. See if it still 164 00:08:44,279 --> 00:08:52,558 exist, ps minus ef grep ntpd, it does 165 00:08:52,558 --> 00:08:56,068 not exist. If it does not exist, then why 166 00:08:56,068 --> 00:08:59,249 we are getting this line. Well, if you 167 00:08:59,369 --> 00:09:02,249 pay very close attention, this is 168 00:09:02,249 --> 00:09:04,529 telling you that the command that you 169 00:09:04,529 --> 00:09:08,069 just ran ps minus ef, when you run 170 00:09:08,069 --> 00:09:10,379 this, the Linux system, the operating 171 00:09:10,379 --> 00:09:14,309 system is so fast and so sure, that it 172 00:09:14,369 --> 00:09:16,469 gets you the same command that you 173 00:09:16,469 --> 00:09:18,479 running. You see it's giving you this 174 00:09:18,479 --> 00:09:22,139 grep, that I ran this grep, and if and 175 00:09:22,139 --> 00:09:24,059 this grep is also considered as a 176 00:09:24,059 --> 00:09:27,059 process itself, within itself. So that's 177 00:09:27,059 --> 00:09:28,829 why it's giving you. You always going to 178 00:09:28,829 --> 00:09:30,839 get this grep whenever you run this 179 00:09:31,229 --> 00:09:36,193 grep command. So this is about ps systemctl command, 180 00:09:36,193 --> 00:09:37,679 and if you wanted to enable 181 00:09:37,679 --> 00:09:39,869 an application, you could just run 182 00:09:39,869 --> 00:09:45,749 systemctl enable ntpd, and this will 183 00:09:45,809 --> 00:09:48,269 enable. See it says create a symbolic link 184 00:09:48,299 --> 00:09:51,209 is create a symbolic link in the etc 185 00:09:51,209 --> 00:09:53,729 configuration file. So now every time my 186 00:09:53,729 --> 00:09:55,619 computer, my Linux machine is going to 187 00:09:55,619 --> 00:09:59,819 start, it will start the NTP daemon with 188 00:09:59,819 --> 00:10:02,369 it Another example of different process 189 00:10:02,399 --> 00:10:07,319 is sendmail or rsyslog. Let's see 190 00:10:07,349 --> 00:10:10,019 rsyslog is another application or 191 00:10:10,019 --> 00:10:11,909 process that runs which collects your 192 00:10:11,909 --> 00:10:15,869 logs. So let's see if it's running. Yes, 193 00:10:15,869 --> 00:10:19,409 you see it is running. And if you're 194 00:10:19,409 --> 00:10:21,689 wanting to check the status, you could 195 00:10:21,689 --> 00:10:27,869 also do systemctl status rsyslog. 196 00:10:27,935 --> 00:10:29,609 [No audio] 197 00:10:29,609 --> 00:10:33,749 And it will tell you it is active and it 198 00:10:33,749 --> 00:10:37,859 is running. So that's how you find out 199 00:10:37,889 --> 00:10:40,979 about all the processes. Now, what if 200 00:10:40,979 --> 00:10:43,829 you want to kill that process? 201 00:10:45,330 --> 00:10:47,790 So let's take one step back, and we'll 202 00:10:47,790 --> 00:10:52,140 run top command. top command is one of 203 00:10:52,140 --> 00:10:54,150 the favorite command for many system 204 00:10:54,150 --> 00:10:57,360 administrators, because this will tell 205 00:10:57,360 --> 00:11:00,780 you about the system resources, or also 206 00:11:00,780 --> 00:11:04,170 one of the favorite question by an 207 00:11:04,200 --> 00:11:06,990 interviewer, who was going to interview 208 00:11:06,990 --> 00:11:09,510 you, they will ask you tell me about how 209 00:11:09,540 --> 00:11:12,060 do you monitor the system? This is where 210 00:11:12,060 --> 00:11:13,830 you could tell them you will run the top 211 00:11:13,830 --> 00:11:16,500 command, and the top command will give 212 00:11:16,500 --> 00:11:20,730 you their total number of total tasks, 171 213 00:11:20,730 --> 00:11:23,850 is running, 169 is sleeping. What are the 214 00:11:23,850 --> 00:11:28,530 CPU, usage, is it too high, is it too 215 00:11:28,530 --> 00:11:31,020 low, what is the memory usage, what is 216 00:11:31,020 --> 00:11:33,720 the swap space, and then right here it 217 00:11:33,720 --> 00:11:36,840 is listing every process that is running 218 00:11:36,870 --> 00:11:39,180 in our Linux environment, with the 219 00:11:39,180 --> 00:11:43,230 process ID, who the user is? And what is 220 00:11:43,230 --> 00:11:45,660 the memory being used? What is the CPU 221 00:11:45,660 --> 00:11:48,060 being used? How long is it running for? 222 00:11:48,090 --> 00:11:55,200 and what is the command associated with that process? So this 223 00:11:55,560 --> 00:11:58,530 has so much information that I cannot 224 00:11:58,530 --> 00:12:01,500 cover in this lecture. So what I will 225 00:12:01,500 --> 00:12:04,770 encourage you to do is, do man on it or 226 00:12:04,770 --> 00:12:07,500 read a lot more about it in different 227 00:12:08,370 --> 00:12:11,430 documentation, I will also include some 228 00:12:11,430 --> 00:12:15,570 documentation that will explain top 229 00:12:15,570 --> 00:12:17,940 command in detail. You could also feel 230 00:12:17,940 --> 00:12:20,760 free to Google it, you could view top, 231 00:12:20,880 --> 00:12:23,760 but you should spend some time quite a 232 00:12:23,760 --> 00:12:27,120 bit time to look into the output of this 233 00:12:27,120 --> 00:12:30,030 command. Now what if you want to get out 234 00:12:30,030 --> 00:12:32,970 of it, just simply type mpt Once you type 235 00:12:32,970 --> 00:12:36,450 Q, you will get your prompt back. Now 236 00:12:36,450 --> 00:12:39,720 we'll go to the command kill. If you 237 00:12:39,720 --> 00:12:42,630 remember, we use ps minus ef to check 238 00:12:42,630 --> 00:12:46,590 which processes are running, grep, and I 239 00:12:46,590 --> 00:12:52,980 wanted to do ntpd. So NTP is not 240 00:12:52,980 --> 00:12:55,320 running. Let's start it first. So we'll 241 00:12:55,320 --> 00:13:01,650 do systemctl restart or start, doesn't 242 00:13:01,650 --> 00:13:05,880 matter, ntpd. It has started, let's check 243 00:13:05,880 --> 00:13:09,060 again, ps minus ef grep ntpd. It is 244 00:13:09,060 --> 00:13:11,820 running. Now I wanted to kill this 245 00:13:11,820 --> 00:13:13,740 process. There are two ways to do it. 246 00:13:13,740 --> 00:13:18,630 One is if you do systemctl and do stop, 247 00:13:20,190 --> 00:13:23,550 this command or you could simply do 248 00:13:23,550 --> 00:13:27,930 kill. kill will kill the process, 249 00:13:28,860 --> 00:13:30,750 regardless of whether it's going to go 250 00:13:30,750 --> 00:13:33,630 down gracefully or not. So which process 251 00:13:33,630 --> 00:13:36,881 we're going to kill right here. This is the process ID. 252 00:13:36,881 --> 00:13:39,709 [No audio] 253 00:13:39,709 --> 00:13:44,160 So kill simply 12027, the 254 00:13:44,160 --> 00:13:47,430 process ID, hit enter. Now let's verify 255 00:13:47,430 --> 00:13:48,881 if it killed it. 256 00:13:50,506 --> 00:13:52,410 Yes, see, it's gone. 257 00:13:52,410 --> 00:13:56,340 Because we are killing the process ID. 258 00:13:56,640 --> 00:14:00,600 The same way whichever process that you 259 00:14:00,600 --> 00:14:03,180 have, you could just do kill, ps minus 260 00:14:03,180 --> 00:14:05,220 ef, and then do more, because you want to 261 00:14:05,220 --> 00:14:07,080 see all the processes. There are tons of 262 00:14:07,080 --> 00:14:09,220 processes that are running through your system. 263 00:14:09,220 --> 00:14:14,280 Any process that is hung you could 264 00:14:14,280 --> 00:14:17,010 kill it. And how do you know it is hung, 265 00:14:17,070 --> 00:14:19,710 you could type top command and you will 266 00:14:19,710 --> 00:14:22,650 see here under memory or CPU if any of 267 00:14:22,650 --> 00:14:25,500 the process is using, let's say 99% of 268 00:14:25,500 --> 00:14:28,950 CPU or 99% of memory, that's definitely 269 00:14:28,950 --> 00:14:31,080 one of the your candidates to use the 270 00:14:31,080 --> 00:14:33,060 kill command to kill it to free up the 271 00:14:33,060 --> 00:14:35,670 resources. System administrators use 272 00:14:35,670 --> 00:14:38,370 this command many times to keep your 273 00:14:38,370 --> 00:14:41,910 system up and running and healthy. Next 274 00:14:41,910 --> 00:14:47,100 we will learn crontab. Let's exit out, and 275 00:14:47,100 --> 00:14:51,660 we will become ourselves. crontab allows 276 00:14:51,660 --> 00:14:58,320 you to schedule our scripts or our 277 00:14:58,320 --> 00:15:00,330 commands whichever way you want to 278 00:15:00,330 --> 00:15:02,220 schedule. So let's say I wanted to 279 00:15:02,220 --> 00:15:04,830 schedule to create a file that has some 280 00:15:04,830 --> 00:15:07,710 kind of output at a certain time. First, 281 00:15:07,740 --> 00:15:10,380 let's check the date. My date is 282 00:15:10,380 --> 00:15:13,620 Tuesday, March 13 2019. This clock is 283 00:15:13,620 --> 00:15:15,960 one hour off, I want to set this clock 284 00:15:15,960 --> 00:15:18,695 first, so become root, set this clock. 285 00:15:18,717 --> 00:15:21,208 [Author typing] 286 00:15:21,208 --> 00:15:26,280 And I'll do date minus s to set. And it will 287 00:15:26,280 --> 00:15:29,820 be, I think I have it set here. Yes, it 288 00:15:29,820 --> 00:15:33,450 will be 13, march 289 00:15:33,516 --> 00:15:35,280 [No audio] 290 00:15:35,280 --> 00:15:36,948 2018. Did the hour, 291 00:15:36,948 --> 00:15:40,118 [No audio] 292 00:15:40,118 --> 00:15:41,336 the hour, 293 00:15:41,336 --> 00:15:43,652 [No audio] 294 00:15:43,652 --> 00:15:46,652 time, the second, 295 00:15:48,000 --> 00:15:50,970 hit enter. And then you do date and it 296 00:15:50,970 --> 00:15:54,180 sets the correct date. Now let's go back 297 00:15:54,180 --> 00:15:59,640 to our self whoami, and we are self, 298 00:16:00,180 --> 00:16:02,550 clear the screen, now let's do crontab. 299 00:16:02,550 --> 00:16:04,650 [Author typing] 300 00:16:04,650 --> 00:16:06,780 crontab is a command self, you have to do 301 00:16:06,780 --> 00:16:09,750 crontab minus e to edit the content, and 302 00:16:09,750 --> 00:16:12,630 specify whatever that you are trying to 303 00:16:12,630 --> 00:16:17,160 schedule. Hit enter, the first, once you run 304 00:16:17,160 --> 00:16:19,020 sorry, once you run crontab minus e, 305 00:16:19,020 --> 00:16:22,260 it will bring you to the vi editor mode, 306 00:16:22,530 --> 00:16:24,750 the same way as if you run vi followed 307 00:16:24,750 --> 00:16:27,060 by the file name. So you are in there, 308 00:16:27,060 --> 00:16:30,210 hit i to insert. The first one is the 309 00:16:30,210 --> 00:16:32,850 minute. So we want to schedule something 310 00:16:32,880 --> 00:16:41,550 at 22, second one hour, 13, then 311 00:16:41,550 --> 00:16:43,890 the day of the month, I'll put every day 312 00:16:43,890 --> 00:16:48,150 which is *, month is three which is 313 00:16:48,150 --> 00:16:50,400 March day of the week. I'll do every 314 00:16:50,400 --> 00:16:52,860 day. Okay, so we scheduled a time. Now 315 00:16:52,860 --> 00:16:54,390 what do we want to do? We wanted to do 316 00:16:54,420 --> 00:17:03,210 echo, This is my first cron tab entry. 317 00:17:03,570 --> 00:17:12,463 And I wanted to put that to a file. crontab-file, 318 00:17:12,463 --> 00:17:18,630 or crontab-entry. So if 319 00:17:18,630 --> 00:17:20,490 you notice the file time has quickly 320 00:17:20,490 --> 00:17:23,220 changed, it already become 122. So I'm 321 00:17:23,220 --> 00:17:26,880 just going to change 23. Hit escape, write, 322 00:17:26,880 --> 00:17:33,569 quit, and hit enter. Now the time is 21. 323 00:17:34,319 --> 00:17:37,500 They still have 43. So let me just do 324 00:17:38,010 --> 00:17:41,444 quickly,2, so this will be don't lose time. 325 00:17:41,444 --> 00:17:47,099 date, 53. Let's see. Do we have the 326 00:17:47,099 --> 00:17:50,970 file created yet? Yeah, this is the 327 00:17:50,970 --> 00:17:53,760 first one I had it before. That's fine. 328 00:17:54,510 --> 00:17:57,870 date 22. Perfect. So let's see, did you 329 00:17:57,870 --> 00:18:00,272 create it? There you go myfirstfile. 330 00:18:00,272 --> 00:18:03,780 [No audio] 331 00:18:03,780 --> 00:18:06,866 Sorry, not myfirstfile, ls -ltr, 332 00:18:06,866 --> 00:18:11,070 it will be a crontab-entry, because we 333 00:18:11,070 --> 00:18:14,550 are doing crontab -l, it created 334 00:18:14,550 --> 00:18:18,930 crontab-entry. And the crontab-entry is 335 00:18:19,380 --> 00:18:22,530 cat crontab-entry. This is my 336 00:18:22,530 --> 00:18:26,100 first crontab. So it did create it. So 337 00:18:26,130 --> 00:18:28,770 but it created itself. So I schedule it, 338 00:18:28,800 --> 00:18:33,060 that's why I created it. To do a quick 339 00:18:33,060 --> 00:18:35,010 comparison of our commands that we 340 00:18:35,010 --> 00:18:39,390 learned with our Windows environment is 341 00:18:39,390 --> 00:18:42,360 the first one systemctl. When you are in 342 00:18:42,360 --> 00:18:43,830 your in your Windows environment, right 343 00:18:43,830 --> 00:18:47,460 click on your Start Task Manager. You 344 00:18:47,460 --> 00:18:49,800 see all these applications, these are 345 00:18:49,830 --> 00:18:52,020 the application you can stop and start 346 00:18:52,530 --> 00:18:55,590 using the systemctl in Linux. These are 347 00:18:55,590 --> 00:18:57,330 the processes that run, that are 348 00:18:57,360 --> 00:19:00,240 associated with all those processes. And 349 00:19:00,270 --> 00:19:02,670 many of them are daemon processes like 350 00:19:02,670 --> 00:19:05,580 service host host process for Windows. 351 00:19:05,790 --> 00:19:09,000 Many of these run as the process. These 352 00:19:09,000 --> 00:19:10,440 are the services that you could shut 353 00:19:10,440 --> 00:19:13,710 down with systemctl and the performance, 354 00:19:13,710 --> 00:19:16,320 remember we ran the top command. The top 355 00:19:16,320 --> 00:19:18,360 command tells you about your CPU, your 356 00:19:18,360 --> 00:19:20,460 memory. Exactly this is what you're 357 00:19:20,460 --> 00:19:22,800 looking at with the Windows Task 358 00:19:22,800 --> 00:19:25,830 Manager. This one gives you the network 359 00:19:25,830 --> 00:19:30,210 usage and of course the User itself. So 360 00:19:30,210 --> 00:19:32,220 this is a quick comparison between 361 00:19:32,220 --> 00:19:35,220 Windows and Linux. And I hope you will 362 00:19:35,220 --> 00:19:37,620 run all these commands one by one to 363 00:19:37,620 --> 00:19:38,610 learn more about them. 364 00:19:38,610 --> 00:19:39,776 [No audio]