1 00:00:00,000 --> 00:00:04,200 [Intro Music] 2 00:00:04,200 --> 00:00:05,640 All right, now let me demonstrate 3 00:00:05,640 --> 00:00:07,590 you how you could get the list of 4 00:00:07,620 --> 00:00:09,840 all running processes. For that you 5 00:00:09,840 --> 00:00:12,600 could use command called 'ps'. If you 6 00:00:12,600 --> 00:00:14,340 enter this command, you'll see 7 00:00:14,460 --> 00:00:16,290 currently running processes for 8 00:00:16,320 --> 00:00:18,750 this particular session. And at the 9 00:00:18,750 --> 00:00:21,600 moment, I am inside of the Ubuntu 10 00:00:21,600 --> 00:00:24,150 container. And I'm inside of the 11 00:00:24,150 --> 00:00:25,890 bash process, I'm connected to 12 00:00:25,890 --> 00:00:27,870 standard in of this process. I will 13 00:00:27,870 --> 00:00:29,580 talk about what is standard in, 14 00:00:29,580 --> 00:00:31,050 standard out in one of the next 15 00:00:31,050 --> 00:00:33,360 lectures. Now, you understand that 16 00:00:33,780 --> 00:00:35,940 I am in bash process; and this 17 00:00:35,940 --> 00:00:37,620 process is listed here with 18 00:00:37,620 --> 00:00:40,230 Process ID 1, here it is; and 19 00:00:40,230 --> 00:00:42,450 here is command that was used for 20 00:00:42,510 --> 00:00:44,370 start of corresponding process. 21 00:00:45,120 --> 00:00:47,340 That means that when you enter any 22 00:00:47,340 --> 00:00:50,220 command, Linux Kernel basically 23 00:00:50,220 --> 00:00:53,880 starts specific process. And as you 24 00:00:53,880 --> 00:00:55,650 may have noticed, here is another 25 00:00:55,650 --> 00:00:57,900 process, 'ps'; and this process 26 00:00:57,930 --> 00:01:00,090 appears here, because I have just 27 00:01:00,120 --> 00:01:02,610 entered command 'ps' that has 28 00:01:02,610 --> 00:01:05,370 started corresponding 'ps' process. 29 00:01:06,569 --> 00:01:09,420 But I have got this output from 30 00:01:09,420 --> 00:01:12,000 this 'ps' process. And basically, 31 00:01:12,030 --> 00:01:14,280 this process did its job, and it is 32 00:01:14,310 --> 00:01:16,710 not needed anymore. That's why this 33 00:01:16,710 --> 00:01:19,020 process was terminated, was stopped. 34 00:01:19,890 --> 00:01:22,620 And if you enter 'ps' once again, 35 00:01:22,710 --> 00:01:25,440 you'll see 'ps' process once again on 36 00:01:25,440 --> 00:01:27,930 the list, but this will be brand 37 00:01:27,960 --> 00:01:30,060 new process. You may notice here 38 00:01:30,060 --> 00:01:31,830 difference between those processes 39 00:01:31,860 --> 00:01:35,910 ID, here and here. Alright, you are 40 00:01:35,910 --> 00:01:38,160 also able to get the list of 41 00:01:38,160 --> 00:01:39,870 different options that you are able 42 00:01:39,870 --> 00:01:42,030 to use with 'ps' command using 43 00:01:42,060 --> 00:01:44,130 following, ''ps --help' 44 00:01:44,160 --> 00:01:46,080 command; and actually, if you want 45 00:01:46,080 --> 00:01:48,240 to get help for 'ps' process, you 46 00:01:48,240 --> 00:01:50,670 need to add also here, which 47 00:01:50,670 --> 00:01:52,590 section of help you want to see. 48 00:01:52,770 --> 00:01:54,690 And if you enter here, 'all' or 49 00:01:54,690 --> 00:01:57,480 simply 'a', like this, you'll get all 50 00:01:57,480 --> 00:01:59,640 available options. And if you'll 51 00:01:59,640 --> 00:02:01,860 scroll a bit up, you'll find the 52 00:02:01,890 --> 00:02:05,430 most commonly used options here in 53 00:02:05,460 --> 00:02:07,860 this first section. For example, 54 00:02:07,860 --> 00:02:11,207 with '-A' or '-e' 55 00:02:11,207 --> 00:02:13,020 you are able to get list of all 56 00:02:13,020 --> 00:02:15,420 processes. By default, you'll see 57 00:02:15,450 --> 00:02:17,220 all the processes running by 58 00:02:17,220 --> 00:02:20,160 current user. And if I'll enter 59 00:02:20,190 --> 00:02:24,570 this option now, 'ps -e', I'll see 60 00:02:24,570 --> 00:02:27,810 same two processes 'bash' and 'ps'; and 61 00:02:27,810 --> 00:02:30,720 'bash' has Process ID 1, and 'ps' has 62 00:02:30,720 --> 00:02:34,440 in my case Process ID 5153. And the 63 00:02:34,440 --> 00:02:36,150 reason for that is that I'm 64 00:02:36,150 --> 00:02:38,760 actually running a small Ubuntu 65 00:02:38,760 --> 00:02:40,920 container, and there are no other 66 00:02:40,920 --> 00:02:42,720 users logged into this container, 67 00:02:42,900 --> 00:02:44,250 there is no graphical user 68 00:02:44,250 --> 00:02:45,690 interface for this Ubuntu 69 00:02:45,780 --> 00:02:47,310 container, that's why there are 70 00:02:47,310 --> 00:02:50,760 only two processes in total. But if 71 00:02:50,760 --> 00:02:53,010 I switch to Ubuntu computer and 72 00:02:53,040 --> 00:02:55,925 list all processes here, 'ps -e', 73 00:02:55,925 --> 00:02:58,140 I will see a long list of 74 00:02:58,140 --> 00:03:00,150 different processes, because here 75 00:03:00,150 --> 00:03:02,070 you see now full featured 76 00:03:02,190 --> 00:03:04,050 computer with Ubuntu operating 77 00:03:04,050 --> 00:03:06,630 system. It has this graphical user 78 00:03:06,630 --> 00:03:08,190 interface, it has different 79 00:03:08,220 --> 00:03:09,960 applications running, that's why it 80 00:03:09,960 --> 00:03:12,690 has much much more processes. Here 81 00:03:12,690 --> 00:03:15,330 is complete list. But if I enter 82 00:03:15,330 --> 00:03:17,340 'ps' without any additional options, 83 00:03:17,490 --> 00:03:19,890 I'll see similar output to this 84 00:03:19,890 --> 00:03:22,770 picture. I see only two processes, 85 00:03:22,830 --> 00:03:26,250 'bash' and 'ps'. And that's what I 86 00:03:26,250 --> 00:03:27,990 have told you, with 'ps' command 87 00:03:27,990 --> 00:03:29,400 without any additional options 88 00:03:29,490 --> 00:03:31,080 you'll see only processes 89 00:03:31,110 --> 00:03:33,780 started by a particular user. And 90 00:03:33,780 --> 00:03:35,790 this user in this case is Bogdan. 91 00:03:36,180 --> 00:03:37,890 Alright, that's all for this 92 00:03:37,890 --> 00:03:39,600 introduction lecture, and next 93 00:03:39,630 --> 00:03:41,250 let me demonstrate to you how to start 94 00:03:41,250 --> 00:03:42,840 additional processes, and how to 95 00:03:42,840 --> 00:03:45,400 kill processes. I'll see you next. Bye-Bye. 96 00:03:45,400 --> 00:03:48,074 [no audio]