1 00:00:00,000 --> 00:00:02,410 [No audio] 2 00:00:02,410 --> 00:00:06,378 Terminal Control keys. Several key combinations on your 3 00:00:06,404 --> 00:00:09,714 keyboard, usually have a special effect on the 4 00:00:09,752 --> 00:00:13,566 terminal regardless of you are logged in with 5 00:00:13,748 --> 00:00:16,578 a PuTTY session or you're logged in through a 6 00:00:16,604 --> 00:00:20,706 terminal through within your console. These control, 7 00:00:20,888 --> 00:00:23,958 which is control ctrl, is the key on your 8 00:00:23,984 --> 00:00:28,194 keyboard, are accomplished by holding the ctrl key, while 9 00:00:28,232 --> 00:00:30,822 typing the second key. So if you're doing ctrl, 10 00:00:31,016 --> 00:00:34,866 hold on to it, and then type the second key. For example, 11 00:00:34,988 --> 00:00:39,030 ctrl c means to hold the ctrl key while you type 12 00:00:39,080 --> 00:00:43,998 the letter c .The most common ctrl keys are listed below 13 00:00:44,084 --> 00:00:48,306 that are used in Linux. The first one is ctrl-u, 14 00:00:48,368 --> 00:00:53,794 which erases everything you have typed on a command line. ctrl-c, 15 00:00:53,902 --> 00:01:02,600 stops or kills a command, ctrl-z suspends a command, ctrl-d 16 00:01:02,600 --> 00:01:07,350 exit from an interactive program. We'll try each of these 17 00:01:07,400 --> 00:01:08,751 keys one by one. 18 00:01:08,751 --> 00:01:24,502 [No audio] 19 00:01:24,502 --> 00:01:31,226 Okay. We are root, because we have pound, we'll exit out of it. 20 00:01:31,348 --> 00:01:35,366 Clear it, cd, go back to our home, 21 00:01:35,488 --> 00:01:39,458 clear it again. The ctrl key, let's say if 22 00:01:39,484 --> 00:01:42,086 you are typing ps -ef, 23 00:01:42,086 --> 00:01:44,723 grep, awk, 24 00:01:46,357 --> 00:01:53,806 sorry, awk, print, dollar one, and you're typing a 25 00:01:53,806 --> 00:01:56,634 a long command basically, and you realize oh, 26 00:01:56,672 --> 00:01:58,530 this is not the command you have to type. 27 00:01:58,640 --> 00:02:02,886 So you could hit back key and it will erase everything 28 00:02:03,068 --> 00:02:05,982 one character at a time, of course it's going to take 29 00:02:05,996 --> 00:02:09,497 a little longer or you could just simply type ctrl and 30 00:02:09,524 --> 00:02:14,122 hit u. It will erase everything you have typed. So that's 31 00:02:14,145 --> 00:02:17,682 what ctrl-u is used for. Second one is, if you 32 00:02:17,696 --> 00:02:23,214 are in an interactive program, let's say you're running top, and 33 00:02:23,252 --> 00:02:25,482 now you see you don't have your prompt back. To get 34 00:02:25,496 --> 00:02:30,942 your prompt back you could type ctrl-c. So ctrl-c is 35 00:02:31,016 --> 00:02:33,978 one of the keys that you're going to be using a 36 00:02:34,004 --> 00:02:37,878 lot more than other terminal ctrl keys because every time you 37 00:02:37,904 --> 00:02:41,574 find yourself stuck, and you cannot get out, and you're not 38 00:02:41,612 --> 00:02:45,354 getting your prompt back, type ctrl-c to get out. Then 39 00:02:45,392 --> 00:02:46,902 you have ctrl-z. 40 00:02:47,036 --> 00:02:51,198 ctrl-z is if you are running a process and 41 00:02:51,224 --> 00:02:54,570 you're stuck in that process, ctrl-z will kill that 42 00:02:54,620 --> 00:02:58,098 process, and it will get you out of it. Then 43 00:02:58,124 --> 00:03:02,190 the last one we have, ctrl-d. ctrl-d, once again, it 44 00:03:02,240 --> 00:03:06,666 does exit you out from an interactive program as well 45 00:03:06,728 --> 00:03:09,226 which is running, let's say if you are running bc, 46 00:03:09,358 --> 00:03:13,158 which is a binary calculator, you're doing two plus 47 00:03:13,244 --> 00:03:16,398 ten, hit enter, you got to do quit to 48 00:03:16,424 --> 00:03:18,178 get out of it, or you could just simply 49 00:03:18,214 --> 00:03:21,498 do ctrl-d. Many of these interactive programs have 50 00:03:21,524 --> 00:03:24,390 their different ways to get out, sometimes quit work, 51 00:03:24,440 --> 00:03:28,938 sometimes simply key works, but ctrl-d is the 52 00:03:28,964 --> 00:03:32,298 one regardless of which interactive program you are in, 53 00:03:32,384 --> 00:03:36,102 that ctrl-d will get you out. These are the 54 00:03:36,116 --> 00:03:41,170 few ctrl keys that you should remember in Linux environment, 55 00:03:41,230 --> 00:03:43,499 they will help you if you are stuck in anywhere. 56 00:03:43,499 --> 00:03:45,941 [No audio]