 So, till now we are actually working in an environment called shell. Now shell is a special program which will accept commands from user. Now when you want to perform some object, some task, now you have to use shell as a interface so that shell will submit on behalf of you to the operating system and it runs those tasks and display the output to you. So it is an interface between the user and then the operating system. If you want to list the files in a directory, you have to submit a command ls to the shell. Shell will take care of listing the directories like passing this command to the operating system and then operating system will return the result to the shell. Now shell will present the output in a user friendly manner on the console. So it is just an interface between the user and the operating system. So since it accepts commands, it also has to interpret the commands which you submit like command usually accepts input file and then to which output file the file the output has to be redirected. So it is also an interpreter. You also saw that there are many switches like for example tar, tar uses minus x minus c minus f. So the shell will recognize this format and it will present it to the operating system. And one more feature of the shell is it is just another programming language. You can have some programming constructs like if, while, for loop, for statements. It is just similar to C but then the syntax is different. When you open a terminal, you see that actually one new process is created that is called bash. Now if you, in your terminals when you type, when you run the command ps, you can see a bash process being running. You can all actually run the command ps, ps command. So if you can see there are two processes that are running. One is the bash and the other one is ps. So bash is the program that will be invoked when you open a terminal. So it continuously checks for the input like input from the user and whenever it gets an input, it runs the command on behalf of the user and it submit to the operating system and then generate the output and presenting on the console. Now there are different types of shells, they are broadly divided into two types, born and seashell. You have two categories again in these two shells, con and bash, we are using bash actually. Now there are different, what is it, differences in these two types which are irrelevant for this session. So I want to skip that part. So since this is a command interpreter, there are features like wildcards. Suppose if you want to list the files which all start with a three letter word called chapter, then you can specify star at the end and you can list all the files which starting with a chart. Let me show one demo. So on your dollar prompt, on your shell prompt, please run these lines. At the end of every line, press enter. So are you done with these lines? So after you run these lines, press ls and see if there are files created. So the following lines will do this. For i in sequence 1 to 9, i is actually a variable here. Do the following, touch chapter 0 and then dollar i. So touch is a command which will update the timestamp of a file. If there is no file, then it creates a file and just update the timestamp of the file. So the output of this program would be new files named from chapter 00 to 10, 01 to 10. So now run another new command ls-chapstar, ls-chapstar. So you see that output is, it will list all the files with starting with chap. Now star here is a wild card which replaces, which matches anything that comes after chap. So there is another wild card question mark. Now it will just match one single character. So when you say ls-chap-0, ls-chap-0 question mark, you will see all the files that are starting with chap-0 and then only one character. So the output is, now if you see the output for the second command, you see that all the files which are starting with chap-0 and then end with one single character. Now if you have suppose a final name with chap-0 and then two or more characters in it, those does not get shown from this command. So question mark is just to match only one single character, any single character. So this, the statements for the first statements, so the output of those commands will create files from chapter 01 to 10. The character before the sequence is actually a backcoat, you will find that key before 01. So apart from these two wild characters, we have again character class. So when you say square bracket 1 to 4, it matches any single character which has 1 to 4 and you can also have alphabets specifying from A to B or A to Z to match in it. If you run this command, if you run this command ls chap-0 1 to 4, all the final names from chap-00 to 01 to 04 will be displayed. Now the second example that I am giving is, it matches any single character that is not C and O. So you can run these switches with any of the commands in C if it is getting displayed or not. So these are, this star has a special meaning. Now suppose if you want to match star exactly, then you have to use some escape sequence. So to overwrite these special meanings, we have to use a backslash. Now to list a file, chap-0 square bracket 1 to 3, you have to run a backslash before the square bracket and similarly you can overwrite this special meaning of this wildcards with double quotations. These are the two ways to overwrite the special meaning that is attached to the wild characters. It is similar to your printf statements in C. Slashn has a special meaning like new line and if you want to overwrite the escape sequence of slash, you have to use two double slashes similarly here. In Linux everything is encapsulated as a file. If you want Linux treat a device as a file, Linux treats the processes as a file. So whenever you run a process, it has two standard streams that it is connected to. One is the input stream, one is the output stream and the other one is the error stream. So these are actually called as standard input file, standard output file and then the standard error file. Now if you want to input anything from a file, you have to use this symbol. Now whenever you are using cat followed by a file name, it defaultly takes the input from the particular file name. So when you want to input a particular information to a command, then you have to use this symbol. Similarly if you want to output the result of a particular command to a file, then you have to use this symbol. Now who is a command to list all the users present who are logged into the system. Now if you want to pass the output of the command to a special file instead of outputting on to the console, you have to specify the file name and then the output redirection. You can try actually on your machines. You have to run the following command cat xyz. Now since xyz is not present in your directories, you will get a error saying that the file does not exist. Now by default the error stream is also the redirect to the output stream. Now if you want to output the error from a command to another file, you have to use error.log. I mean any file name and you have to put the redirection. It can be any file name if you want. So till now we have been running only single commands. Now there can be situations where the output from one command can be used as an input for another command. If you want to display the number of user presently logged into your system, you may have to run in terms of two commands. First you may have to run who and redirect to the output to a particular file and then you have to count the number of lines present in that particular file. So this can be done in a step of two commands. Now if you want to redirect the output of the first command and act it as an input to the second command, we can actually remove the usage of the file and then we can directly get the output. So that can be done using a special symbol called pipe. So there is a backslash key on your, present on your keyboard and if you have to use shift along with the backslash to use this to get this symbol, this is called pipe. So when you run this command along with a pipe, the output from the first command is not displayed on your console. It is actually redirected to the next command present on the other side of the pipe, WC. Now if you want to see the output as well on the console, you have to use another command called T. Now when you use T in conjunction with the who, so the output of the who command will go to the T and then T displays on the console as well as write to a file, user file. You can actually run this command and see. Now command substitution is another way of creating a communication between two commands. Basically we have seen pipe, the role of pipe as a communication tool between two commands. So there is another way of doing a communication between two commands. This is command substitution. Now if you say, if you run this command echo, today's date is within the single quotations date. The date command is executed first and then passed to the echo command. Now I want to run this first command. See you have to use the key besides the first and similarly the second statement, it prints out a statement listing the number of files in your current directory. Now in this command substitution, I have used again the first communication tool that we used pipe. We will list the contents of the directory and then this is passed to the next command wc. Now wc will count the number of lines. So ultimately it list those number of files present in the directory. There are, I mean, shell does not end here. It is actually a programming construct where you have if else statements and then for loop and then while loop. The complete reference can be obtained from the following link. You can use that source to learn more about the constructs. Thanks.