 So, I am Madhu Belour, I am in electrical engineering. So, let us start with using Linux tools. So, please note that using Linux tools is something that one will not just watch on the watch the slides, you have to practice this hands on also not just using Linux tools the entire workshop you have to simultaneously practice without that it is not going to work. Yeah, please do not feel that here you just watch and during the week during assignments only you will start doing hands on that will not work. So, for the same reason we have another computer connected here on which I will try hands on the various commands that we will start seeing in the slides. So, this is a quick outline of the various things we will cover today and tomorrow. So, FOSS has already been explained in detail. So, what is free about it? It is much more than just free freely available tools it is in fact also free for modification. The Linux itself has been inspired by Unix, but Unix was not open source, but Linux the entire kernel everything is available for viewing and for changing. So, there is a close link with something called GNU philosophy. So, there are plenty of libraries available in Linux for scientific computing important thing is can run forever. So, this is extremely important because people are used to windows and if you do not shut it down once a day or once in two days it is going to hang, but Linux people forget to shut off during weekends meaning for the entire week it is running during weekend also it is running for another week in other words it can run forever. Of course, that is a sad thing nowadays with so much energy problems one should learn to shut down the computer regularly. So, we are going to be speaking about the shell. So, shell meaning shell we will also use the word command prompt. So, the Linux command prompt and the Linux shell is what we will spend time on today and tomorrow, but of course Linux also has a GUI a graphical user interface, but that is what is anyway easy and very similar to Microsoft windows which everybody would have been familiar with. So, we are going to spend time on command line for this particular module. So, while it says control alt F1 control alt F1 indeed gives you a command line interface what we are going to do is we are going to run all these commands inside a terminal. So, please open the terminal on all your Linux computers. So, how do you open terminal if it is open to Linux then you can press alt F2 and type genome dash terminal there. So, if you have difficulty opening the terminal. So, this is the correct time for you to start the terminal now please start the terminal on your own computer. If you have difficulty please ask the coordinator we wait for 2 minutes for everybody for all the 860 participants connected to all have the terminal open now the terminal will look something like this. Clear is the command to use for clearing the screen what we are seeing here is what is called a command line interface a shell a terminal. So, the second is everybody having such a prompt like we have a dollar here where one can type various commands of course this is not a right command LS is one of the simplest command for seeing a list of all the files in that particular directory. So, I hope everybody has opened a terminal on one's own computer the terminal itself happens to be also available on Microsoft windows, but then we are now emphasizing the terminal on the Linux for this particular module. So, once somebody has already opened the terminal once somebody has opened the once somebody is on the command line terminal. So, one can ask where which directory are we in. So, pwd stands for present working directory pwd is what when you type pwd is a command after pwd you can press the enter because of which we have the output on the screen it says that in this particular computer that I am working in it is in something called home belur desktop is a directory inside this belur and then the directory called test files. This is where we are currently in if you want to see the list of files inside this directory we can see that there are these three these three are files or directories. So, incidentally it is showing in blue color because these are directories one can go to another directory within this this is what we can try now cd one let us say one using Linux tools. So, notice that I typed just one and then press the tab key to press the tab key means it will try to auto complete it will complete as long as there is no ambiguity yeah. So, one I pressed one and then I press the tab key then it completed because after pressing one there is only a unique completion rest all others one starts with two one starts with five. So, what is starting with one only one underscore using Linux tools. So, we can press this and press enter. So, what we have done is we did cd meaning change directory to the directory name. So, we will say cd is a command and whatever you typed after that command is an argument cd argument in this case argument is a name of the directory into which you want to go why do not we do pwd now. So, we expect that now we are in home belur desktop test files and also one using Linux tools yeah. So, this is indeed a very long present working directory because of the long names of the directories we have given. Let us see what is there now there is something called examples we could also navigate and go there. So, let us do that when that is indeed the next topic to see. So, in when these slides were made when LS was typed there these were the files that were visible one could also see the files inside inside not just the current directory, but also a directory one of the existing directories that is also possible. So, please note in Linux like in Unix all the commands names of the files are all very much case sensitive unlike windows here capital or small does make a big difference. So, please note LS all these LS is a command all the commands are typically small letters unless they are contributed by somebody and names of the directories names of the files can of course be capital or small we avoid spaces inside the name of the file or directory if there are spaces then what to do we will see very soon, but we avoid it generally speaking. Now, how do you make a directory yeah. So, this is what we will see now. So, we were here last let us go into examples these are the various files here why do not we make of new directory called test directory. Now, when we see we have in addition to these files that were already there we have something new that has got created called test directory further notice that this test directory is blue whether what color it is of course depends on the terminal it depends on Ubuntu the operating system it depends on what term some variable called term what term we are using whether colors have been enhanced. So, please do not become too much dependent on the fact that it is blue that is why it is a directory that is a minor detail that may not even be there available in all terminals. So, one can do LS minus L LS long minus L now we will say is an option for LS command L is some option we want to give and these options that is why have a hyphen when we give LS minus L I made the font slightly small for you to easily see. So, when you do LS minus L then we see that we have all these dash here because these are files, but precisely where we have test underscore directory there in addition to it being blue in addition to it being blue we also have D here this D here stands it says that it is a directory whether it comes in blue or not at least this D will certainly be there because it is a directory that part of the information that comes out will not change perhaps blue color may be red color in some settings well what about test one can say check what type of file is this test it says some ASCII test ASCII text what about test underscore directory it says this is a directory. So, file is a command that one can use to check what type of file is this is it a PDF file or is it a directory is it a text file there is also just some plain ASCII English text one can go to test underscore directory now and see what is there of course this is a directory we created just now quite understandably there is nothing inside it already we can go to one directory before CD space dot dot this goes to the parent directory. So, dot please note dot means the current directory double dot means the parent directory after the command after the command CD always there will be a space yeah if there is no space then the command itself is different command is CD here after which use put a space and then dot dot that goes to one directory before so called parent directory again you can type this you can go to one directory before again by CD space dot dot yeah. So, only now I am emphasizing that you have to put the space yeah if there is no space yeah CD dot dot if we do let us see what happens command not found it has included the dot dot into the name of the command yeah you could type any some sort of expectedly meaningless command and we do not expect such a command to exist yeah. So, notice that that entire name has come after which the colon has come yeah this is not a command it knows yeah sorry I had made the font smaller for a particular purpose. So, if you type something that is not a actual command then it will say command not found. So, please learn to read very carefully what comes out if it does not do what you intend it to do it will give the error from the error you please have to infer what has gone wrong yeah CD dot CD I said space dot dot, but if you do CD just dot dot it is saying command not found yeah please note there is a space yeah and now it has done what is required why we can check present working directory and see we can see that this one underscore using Linux tools into which we had gone some sometime instance before it has gone back we can go another yeah. So, this is how you will navigate through various directories into various directories into the previous directory into the parent directory we will call this as parent these are all sub directories sub directories are like children yeah you can go further further deeper and deeper into the sub directory let us go back into test underscore files and we had seen there are several directories here let us go to this other one yeah this latex is what we are supposed to learn next weekend, but then there is no harm in trying to see what is there inside yeah. So, here we have gone into the directories of another so I can understand that these directories these files are not already there on your computer you can create your own directories try to go into the directory again try to go back into the parent directory let us go back to using Linux tools let us make another directory another test so please note I am typing another underscore test this particular key I have typed is called underscore yeah so why because we do not want to have spaces in the name of the file names if you want we can also put hyphen another dash test yeah these are clearly two different directories one with underscore one with hyphen one with dash yeah so now notice let us use this tab again CDA so it has completed up to another then there is some ambiguity one directory has this underscore another directory has this dash that is why it would not complete beyond that if you type another tab then it will tell you the two possible completions yeah why there has to be two or more completions because of which that ambiguity was there and it has not completed so now you just type one letter to resolve that ambiguity and then press tab again and it will indeed complete successfully now because of no other ambiguities so let us go back to the slides the slides incidentally has an example where we have a space inside the name yeah I told that we do not like these spaces but in spite of that these slides are telling that they should be the spaces yeah that is because you might often copy this directories sub directories from some window structure and you already have these spaces inside and we have to know how to deal with the spaces yeah they may not be preferable but they are they can easily occur for various reasons so let us see how to create a directory called software space engineering in two different ways so we are going to again go back to the command prompt go back to the terminal and type which command make directory software engineering with space in the middle yeah instead of space notice that there is also this slash yeah backslash I believe also if you do not want this slash you can put it in double quotes these are the two things we will type and see to please notice that there is this escaped word here yeah this backslash we will like to say is an escape character space space is an important thing that is what we will see now and if you want to want the space to come in literally then you have to escape it escape it using a backslash make directory after the command as I said there has to already be a space yeah make directory new directory new directory if we type like this what will it do it has created two different directories called new and directory did you intend like that you intended one directory with the name new directory yeah and we did not put hyphen in the middle we did not put underscore hyphen in the middle because of all this if you put a space it is like another argument to the to the command make make there if yeah we have given two arguments and for make they thought that you want to make two directories two directory names are being given one directory name that you want is new another directory name you want is dir you can also do ls minus l if you think that it has just interchange the order that is not the case it has created two different directories cler is the name for clearing the screen yeah very soon we will try to spend some time on some shortcuts for these so ls minus l will tell you that there are two directories d and n yeah I think typically these are alphabetical that is why ds come up so how do we actually make a directory called new underscore new underscore directory just type new underscore directory but new space directory if you want now and you do not want to create two new directories why do not we see what happens because these are already existing yeah new sorry thank you if we type again it says that we cannot create it why because it is already there yeah what is already there it says file already exists yeah I think in this linux unix operating system file and directory are more or less the same yeah so for that reason it says it already exists why do not we do make make there new backslash yeah now when we do it will take the space as literally now it has indeed created it has created it has created a new directory called new directory yeah as was written there we can also put it in double quotes if we started with double quotes we will put it in double quotes software engineering is now one directory there is a space inside if you want to go into that soft then we can press a tab it will go yeah and when it is going it is showing us that it has escaped the space it has escaped the space using that backslash yeah of course there is nothing in there let us go back to the slides so please note generally we use hyphens and underscores instead of spaces in the names for this reason because we have to escape it also when we see a list of all the files in the list that is visible the space will not be there but you have to use a space the backslash will not be there but you need the slash when you are moving to directories so far shell scripts it is going to be a little problem for those reasons we just avoid using the space so we have already seen how to go to various directories how to see the present working directory it says you can also do cd space dot slash seas yeah seas so you see that our slides all have seas as the name of the course that is because seas stands for software engineering for engineers and scientists yeah I am digressing from this using Linux tools for a minute we see the seas again again the various directories various names of the modules that is because seas was indeed the name of the course we had kept for this particular course when we tried to introduce this course in IIT curriculum that is the course that is running now the one semester will finish now in another two weeks the semester will finish but when we were introducing this course that I am the course was recommended the name software development techniques yeah so I am in electrical engineering department we were not aware that software engineering happens to be some important term in computer science literature their software engineering refers to perhaps yeah those participants of you who are from computer science engineering departments are would already know software engineering is an existing term and our course is actually about software development techniques for engineers and scientists so the new course is S D E S so we will change all the slides but anyway if it is only name of a directory it does not matter seas is the name of the directory as far as the slide is concerned so we want to go into the seas directory so you see that there is only one single dot here yeah I only told what is double dot double dot stands for parent directory that we see here yeah CD space dot dot goes to the previous directory but just dot itself is also often required we want to have a way of specifying the current directory the present directory so dot alone stands for the present directory yeah so sometimes you may not have to explicitly use this dot yeah here it says alternatively you can say CD space dot slash seas yeah so you can use CD space dot slash seas dot stands for current directory from the current directory you want to go to seas their dot may not be required yeah let us see what happens we will make okay where are what is the present working in that tree some really long name why don't we go back even to go back one more yeah so this is our present working directory relatively short now let's make another let's call this D1 D2 D3 from now on otherwise all these paths are becoming long yeah so let's call this dir one numbers are very much possible so let's see what's there now let's dir one also let's go to dir one let's make two directories now dir two dir three yeah these are two separate directories so when you want to give an option then the hyphen is very much important yeah so when you use on your own computers so you don't have to make the fonts larger and smaller the way I am doing I am doing the font smaller only when we want everything to come on the same line so we have this two directories dir two and dir three so suppose we want to go to yeah this is one way we already saw yeah but you could also specify that from the current directory we want to go to dir two yeah meaning of this is CD dot slash dot slash means from the current directory you are specifying the further path from here so we are here now yeah we could also in so please note that this dot is important you cannot say CD slash there's something this slash refers to the earliest yeah so yeah please please take careful note what is being done now we are currently in present working directory whatever is on the screen if you do CD slash this goes to yeah PWD now is just slash yeah is this called the root directory root just slash is a root directory yeah we are not we don't our directory two directory one that we created is not here and anyway let's see what's there here this is what you can see on your own computers we cannot make most likely we can't make a new directory here yeah therefore it says look you can have permissions to create various directories various files inside your home directory you cannot go to the root directory where the super user is supposed to have the permission only only the super user is supposed to have the permission yeah it says permission denied permission has been denied to us because we are only a simple user not the super user not the root so why don't we just go back to where we were and try to create our directories over there not ambitiously created in the root directory so how do we go back to where we were are we going to type the long path yeah so there are we will see in more detail tomorrow some shell variables so why don't we just go to the old present working directory yeah so in just one short we went to where we were yeah you each one of you can go back to where you were by using the long path there incidentally there is some particular environment variable called old pwd yeah if you change your directory then automatically this present working directory in old person old present working directory variables are having this information if you if you are very lazy don't want to type long long then you can keep track of these variables and just go back there suddenly yeah so these shell variables are seen by using the dollar prompt these don't feel that these are some things that is outside the course very soon tomorrow is when we will see these shell variables in more detail as far as I am concerned we just went back to this directory now yeah so we were seeing whether whether to specify the full path yeah we are here now that we can go from here to there one again there when we press the tab there are these two completions let's say there three yeah when whenever you press tab and if it's a name of a directory when you press tab it will end with the slash slash means it's a directory that is why you have room for going further it's a directory so you can go there and see what's there of course these are directories we created sometime ago there are no files there so let us see how to just create a new file how to edit this file that's the next thing we might see so touch command yeah creates a blank file so we have been creating these directories there are no files only files we saw were already there in my in my computer perhaps you want these files also while these files are already kept on Moodle you might want to just create this file how do we create this new file yeah are we going to open open open office or some big editor for just creating a blank file are we going to do that no touch is a very useful command for that purpose so please see the various commands on the screen while we try these commands here and create some new file yeah so please note here we have inside this particular directory 3 there are 3 we don't have any files that is what we do ls ls minus l we'll say look there's nothing yeah so please note just l ls a l after all in the current directory what is certainly there is a current directory itself also there is a possibility of going to the previous directory why don't we do ls minus a l ls minus a it says show really all if all I think it says that look there is this dot directory and dot dot that possibility is there these are the 2 directories but more generally there might be some file names that start with dot yeah these are ones that we we are not really interested in editing again again for example in your own terminal in your home directory there will be one dot bash RC most likely yeah because that is the script that starts default nowadays bash that is the one that we will teach in detail so dot bash RC perhaps will be there not here not in this deep sub directory but inside the home directory so why don't we create that particular file now so we'll touch file 1 file 2 dot file 3 just for the sake of explanation yeah file 4 dot t txt file 5 dot pdf why don't we create a empty PDF file yeah please note we are creating empty files with different names some of them are starting with dot some of them are having extensions some of them are not having extension some extensions are ridiculous yeah empty files file nobody prevents us from creating file 6 dot doc yeah luckily Microsoft has not patented the doc extension name already we can just create this empty one low we have so many files suddenly yeah we are created dot file 3 also that is not here all other files are here yeah I mean some cheating is going on here dot file 3 did it not get created or did it get created but it is not visible here so why don't we do ls-a and see look here dot file 3 is visible yeah the purpose of this exercise is all file names that start with dot in other words they have only an extension yeah of course dot file 3 is not an extension but it starts with dot those are not visible generally yeah hidden to say that hidden is too much yeah but they will be visible if you use the a option ls-a will show them to you yeah there are all this txt files pdf files file 1 file 2 what do they have inside them yeah we have not yet seen how to see inside a file inside this pdf file how to how to view them do we need acromod acrobat reader yeah is it really a pdf file it is all an empty file the same command touch created all these files these are all empty files why don't we see ls-l ls-l has is showing us all these files yeah there is sorry there is this particular column this column being 0 means that the size of this file is 0 whether it is 0 bytes or 0 kilobytes or 0 megabytes how to make that information come in a very useful form we will see later but if it is 0 then it is 0 megabytes 0 kilobytes 0 bytes 0 bit it is a it is a empty file yeah what type of file is it yeah just because it is a pdf file is it is it does it really have a pdf content yeah why do not we see file file file is also a command yeah so the way we are using it here increase the font size again file the first thing we type in the prompt is a command then there is always a space there may or may not be an option and after that there is an argument yeah file as a command requires an argument yeah you cannot type this file says look the usage of this file command is requires this option and then I suppose to say the file sorry I use my hand see what just type file on each of your terminal yeah we want to get used to being told something is incorrect yeah we all all all the participants should learn to type commands wrongly should learn to see what is written on the screen learn to infer oneself what is gone wrong we are very much available for help but then at the end of this course you all want to reach a stage where you can help yourselves yeah so we want to teach you to do that also so please type this command file just file no argument no option also if you do that this bash terminal is very polite it is not saying that you guys are typing things wrongly intentionally it is saying look this is the usage usage file usage this how we are supposed to use command square brackets square bracket please note square inside the square bracket there are some dash yeah how do you may understand this whatever reason square bracket is like optional you may or may not want to type on the command will work even if you do not type that yeah that is why it is in square bracket if you want to type an option B then type file minus B file space minus B then there might be some other options yeah these options for example minus E if you type minus E minus E option requires a argument yeah just that option minus itself might require a argument minus F itself might require an argument at the end of this finally there is this file yeah I mean the file command cannot cannot proceed without the main argument that is why it is given this error it is not it is not told us quite politely quite politely it has not told us that there is an error it is telling us this is the usage if you want more help file minus minus my keyboard is typing extra characters so file minus if then if you type see why I am emphasizing file command incidently file file I believe is a extremely important command but is not listed in the slides you will certainly try our best to include this in the slides but this is something you can take note of meanwhile file minus minus help will give you details of all this various options yeah when we type just file it just told us this is a usage all these different options what are they supposed to be used for who will tell us that file minus minus help will give us the detailed information yeah there are different ways to get this information currently the usage is file minus minus help there is also a man page perhaps there is also help file help file there is no help topic there are different ways of this help information being organized there is also man file yeah so there is man is another so I am typing this very fast but very soon we will cover all this in the slides yes man is something called manual man for manual I think man file will give you a detailed manual queue for exiting out of this man out of the man page if you want to exit and come back to the prompt queue you for quit so we were in the process of creating various files creating various empty files using the touch command we already noted that one particular file is missing which we can see by typing like this this is the right way to type this is the right way to type the option minus a let us see this is command not found yeah it is taking ls minus a all together as a command as I said ls itself is a command and a space had better be there why because minus a is an option the syntax is command space option space argument you can you can also give an argument file one yeah it says yeah just if that file one were a directory yeah make directory dir dir file dir 4 so here we have these you can do ls dir 3 dir 4 this is what was there in the slides before directly lists the lists the files that are there in dir 4 of course there is nothing at least there is nothing that does not start with dot ls minus a dir inside dir 4 there is actually a dot and a double dot these two will always be there there might also be some let us let us see this ls minus a when you do so it has again shown us this dot this dot it has shown that is nothing but the current directory I told is double dot that stands for the parent directory the previous directory that is this dir 4 that we have created just now please do not bank on it being red on blue color because it is a directory and different terminus may show it in different colors yeah all these are of course files this dot file 3 was the one that was not shown unless you put the dot unless you show the minus a option ls minus a l when we do then it is showing us all these directories of course have some some size on the hard disk some 4096 bits or bytes or kilobytes I have never understood but do not worry about it it is a small number in any case in these days of large disk sizes no need to worry about it so dot file here is visible and therefore importantly has this d d at the start rest all to notice all these are 0 after having noted that they are 0 we want to now see what type of file are these why do not we see file file 1 it is empty file we were seeing the usage of the command file for this purpose all these empty files we have created what type of file is it file file file file 5 dot pdf file 5 we press and press a tab key only one way it can be extended can be completed file 5 dot pdf just because you gave it the extension pdf does not make it a pdf file it still is an empty file you might cheat the user by giving different extension names but the operating system has not got cheated the file command itself is very much able to see what that file is let me copy a example let me copy a file here so cp for copy we have not yet seen that particular command so I have copied some other file in my particular computer I know it is somewhere else I am copying that file to the current directory so how does this cp command work cp see cp ls mv cd cp for copy mv for move we will see this very soon please do not take notes it is not required the slides have all this information just that I find that right now is the correct time to say it that is I am saying it so cp is a command for copying a file from somewhere from a source to a destination place and in the destination to specify that it is very helpful to have the dot cp command we will see in very much we will see in much more detail so before we go further before we also stop for t this is a good time to stop for doubts yeah so why why I strongly encourage you all to also interrupt me for asking doubts this is a place where we will stop ask various doubts please do not ask doubts about cp because cp we are anyway going to cover in detail we will clear doubts about that as we go on so please ask your doubts one by one now so please please ask your doubts you can contact the coordinator to initiate the initiate the button there so that we are able to know from here who wants to ask the doubt and will connect to that person you can also ask your doubts on chat if you have doubts in the users list there is a hand raise button in under the users list there is a hand raise button there is a hand raise please press that button and then immediately here we are able to see that there is a doubt from so and so place and we will immediately connect yeah please ask we are connected to Udaipur now please ask your doubt we are able to hear you I think yeah so my question is that when we are writing a command like ls-ale then the first thing we are getting is a total so total total number of changes so what those number are total number of changes because whenever we are making a new directory this number are changes by 4 thank you for the question we in IT Bombay could hear the question let me repeat the question so that all others can hear it in case they have not heard it the question was that when you create a new directory you go to the directory and type ls and then there is some total coming so total comes on the top if there are other things in the directory then of course there will be many other things also visible but what does this total mean perhaps this let us try this the total perhaps means the total number of files in files and directories inside that and if it is 0 if there is nothing there if you make a new directory there is nothing yet there so then it will come as 0 why don't we type here ls ls-l we will have that extra information so please note so here we have this the question was what is this total yeah so total total why don't we we created this directory dir 4 let us see inside dir 4 what is that total here it is 0 while here when we did it had 4 things is 4 the total is that 4 the total number of things number of files excluding directories yeah so my friends here who know about this and I don't know about this I didn't know so far so it turns out that 4 number stands for the total number of files yeah but file number files is 5 here 1 1 1 1 1 stands so this 1 stands says it is a file I think this 2 says that it is a directory number of links to so to say this is 4 and this 2 stands for you come back from this from within the directory and from here that is 2 see I thank you for this question I don't know this answer and after using Linux for 15 years I don't know the answer so most likely it's not important for further usage yeah but then if somebody of you can find this out and tell us we all will benefit from this that is the best I can say because we should go to other questions which are likely to be of more use to everybody yeah okay so the next question is from Kakinada good morning sir good morning if you ask one question you told me you told that you can create any file with an extension of anything so I want to create an extension of file name by dot BAT that is something like a batch file which you are doing in a DOS operating system so can you create a same kind of file in unique operating system also this is a good question see we are at a stage where we are just creating new files using the touch command and I put PDF and TXT as a example just to say that you can create any file with any extension yeah and the Linux operating system the way it works does not really depend on the extension you give and if it is a batch file in DOS we have dot BAT extension and that is like a shell script in bash we will give SH extension when we come to that we will certainly cover this in more detail but the batch file itself will not run here the way it runs in MS DOS simply because it was all DOS commands there here we have Linux commands so but then nobody will prevent us from naming a file as file dot BAT so we will stop for T now please post your questions on chat and we will certainly also take up the questions live on audio but then if you have typed on chat we can take them up first yeah thank you very much we meet in 20 minutes thank you.