1 00:00:00,000 --> 00:00:02,710 [No audio] 2 00:00:02,710 --> 00:00:04,546 Shell. What is the shell? 3 00:00:04,738 --> 00:00:07,954 In this lesson, we'll cover about the shell, how the shell 4 00:00:08,002 --> 00:00:11,478 work, and how you can run command within the shell, or 5 00:00:11,504 --> 00:00:14,230 how the environment is set up in a shell. 6 00:00:14,410 --> 00:00:16,690 So what exactly is a shell? 7 00:00:16,870 --> 00:00:18,850 Shell is like a container. 8 00:00:18,970 --> 00:00:21,438 Like you have like a tupperware in your 9 00:00:21,464 --> 00:00:24,694 home or any kind of container that holds 10 00:00:24,862 --> 00:00:28,280 your environment your information inside of it. 11 00:00:28,910 --> 00:00:31,890 It interfaces between users and 12 00:00:31,940 --> 00:00:34,198 Kernels or operating systems. 13 00:00:34,354 --> 00:00:36,798 So you have built an operating system, 14 00:00:36,944 --> 00:00:40,254 and then it has provided a platform for 15 00:00:40,352 --> 00:00:45,078 you to execute commands. Again, Windows is one 16 00:00:45,104 --> 00:00:48,522 of the platform, and in Windows operating system, 17 00:00:48,716 --> 00:00:52,438 when you start up a GUI, you execute commands 18 00:00:52,474 --> 00:00:54,980 by running, by double clicking on a program. 19 00:00:55,370 --> 00:01:00,534 So that GUI interface is your shell. In Linux, when 20 00:01:00,572 --> 00:01:04,414 you don't have a GUI, you are given a terminal 21 00:01:04,462 --> 00:01:08,070 shell or CLI command that is your shell. 22 00:01:08,810 --> 00:01:15,090 To find your shell you could run a command like echo dollar 23 00:01:15,090 --> 00:01:18,022 and zero, that will tell you what shell you are in. 24 00:01:18,156 --> 00:01:20,134 And you could also get a listing of 25 00:01:20,172 --> 00:01:22,678 all your shells in your Linux distribution by 26 00:01:22,704 --> 00:01:25,030 running the command cat /etc/shells. 27 00:01:25,470 --> 00:01:30,050 Your shell is also inside of /etc/passwd 28 00:01:30,170 --> 00:01:33,730 that is defined inside of the file. 29 00:01:34,650 --> 00:01:37,538 In Windows, GUI is a shell, in Linux, KDE 30 00:01:37,634 --> 00:01:43,022 GUI is a shell, in Linux sh which is shell, bash, etc. 31 00:01:43,106 --> 00:01:46,406 All these are the shell that is provided to a user. 32 00:01:46,538 --> 00:01:48,634 Again, we're looking at this diagram, again, 33 00:01:48,732 --> 00:01:51,070 and we are second from the top. 34 00:01:51,120 --> 00:01:54,206 You'll see the application that talks to the shell 35 00:01:54,278 --> 00:01:56,878 and then shell talks to Kernel, and Kernel is 36 00:01:56,904 --> 00:02:00,490 the one that is telling hardware what to do. 37 00:02:00,660 --> 00:02:03,698 Let's look at our Linux machine and we'll 38 00:02:03,734 --> 00:02:06,010 see how we could find our shell. 39 00:02:06,330 --> 00:02:08,100 Open up a terminal real quick. 40 00:02:08,100 --> 00:02:10,229 [No audio] 41 00:02:10,229 --> 00:02:14,230 And when you do cat, sorry when you do echo 42 00:02:15,030 --> 00:02:18,910 dollar zero, it tells you you are in bash. 43 00:02:19,710 --> 00:02:22,954 So you could look at the available shells that is 44 00:02:22,992 --> 00:02:26,482 installed in your distribution by doing cat /etc/shells and 45 00:02:26,496 --> 00:02:28,834 it tells you all the shells that are available. 46 00:02:28,992 --> 00:02:36,610 And when you look at /etc/passwd, cat /etc/passwd 47 00:02:37,350 --> 00:02:41,662 and you'll see in my username, which is right here, 48 00:02:41,856 --> 00:02:45,802 it tells the shell all the way at the end 49 00:02:45,876 --> 00:02:49,058 that I have a defined shell which is /bin/bash. 50 00:02:49,214 --> 00:02:51,214 I could change that shell if I want 51 00:02:51,252 --> 00:02:54,238 to, to a different shelf, but I try 52 00:02:54,264 --> 00:02:56,510 to keep it consistent with other users. 53 00:02:56,570 --> 00:02:59,350 So that's what the shell does and we'll cover 54 00:02:59,400 --> 00:03:03,478 the later, in the later lessons, how we could talk to shell to 55 00:03:03,504 --> 00:03:07,633 create scripts and other things to automate our tasks. 56 00:03:07,633 --> 00:03:08,779 [No audio]