So that's the last day today of these three-day sessions and we will go through some useful utilities like how to make the archives and how to transfer the files over the internet and how to make the there will be also different types of transferring. There will be one exercise with respect to that one and then we will come back to the utilities that I still want to show you how to use and we will practice with them and then on top of that I will show you a couple of techniques how to make them to work together. So in particular we will if we know already something about piping but then today we will learn also about redirections and then about some grouping about some bullions how to use this very very simple conditionals on the command line and on the at the end of the session we will go also for the initialization files. So how to set up your environment and then how to make it more or less permanent so that every time when you log in you will get exactly the same environment for yourself within the bash. Okay but let's go to the file archiving so there was a couple of requests which I read already yesterday but let's make it slower I'll do my best I promise you but so I'm on schedule and still trying so so my idea here is that I give you as much as I can based on my experience and you get as much as you can based on your experience but just try to get information so all the information which is given over here is useful and based on the tens of years of different experience with working with the Linux etc. So let's go to the file archiving and transferring so there is one utility star so I already named a little bit like Unix once like find then you already touch a little bit grip then tar tar is yet another one that's the one which comes from the very long ago times from the the old times in a sense that it's when archiving was yet on the tapes and actually name exactly same this so it's tape archiving but it's still the standard defect so when you when it comes back to something when you need to archive then most probably on Linux people means that this archive will be dot tar dot gz so target or in other words and that means that you better know how to use that because most of the software which is distributed around it's in this kind of archive and that means that you should be able to open it on your own and that also means that you should be able to work with that list the archive see what's inside and understand how to make your own archive for a sake of distribution so tar once again you can go for the manual page and see what's there and you will see pretty long list of what kind of things can be done the long list is simply because the itself utility is very old and but basic practice practical things are quite simple so what you need to know about the tar archive is how to make it and now and then how to extract the files from the tar archive let's start doing it right away so for instance i will i'm still in my demo space i clean up the ps today a little bit from the rest of the that we don't really need but there is some stuff left and let's try to make the archive of that stuff so what i'm saying here that please do the compression that stands see so one thing with the tar archive and utility is that you can use the notation which is very common Linux when you put the options with the minus something or in the same way like ps this process managing utility you can also leave this minus of that comes from the older unit time but that still works so both were okay i will just for a sake of consistency we'll use it minus as well so here tar minus c means compression and then i put file in a sense that compression doesn't really comes with a compression so it's in tar point a few it means packaging so when you get some directories files sub directors inside them and you kind of make out of them a one single package that package would be simple called you need to come up with some archive name let me be simplistic over here so i just use the archive and then oh let me say that it's a demo space or car and then i know that my demo space is actually the directory which comes which i am in so but i can say it this way demo space let me do one thing before i continue so i go just up just do not get you confused completely so in my demo space will be and then in this way r cf and then demos space dot tar and then the demo space so what i'm putting over here i'm putting here first what i want to do so i want to make it compressed and then i put here the file and the file which comes out should be this one so that's the have a misprint over here that's going to be my archive after the activation is done and the next come what exactly comes to that archive so let's try it so now i am in my i am in my home directory and i can see that that has been created there is a size of that then there are some permissions and demo space is there but i can use also just first take a comparison there is this common called disk usage disk usage tells you exactly what's the size of the uh what's the size of the directory for instance so now i can see that my director is about 40 gigabytes and then the archive is also about well it's 30 gigabytes a little bit less so there's some kind of compactness has presented over there but anyway so that also means that actually it hasn't been compressed probably what has happened over here the thing is that as i told you already tar can compress the final archive or cannot in order to include the compression so you can put the a over here and then put at the end of the archive file name some type of compression in linux the most common is the gz so in the same way like in windows and mark that would be zip so this is kind of gzip which is a common compression compression algorithm for the for the linux so and most part of the packages will be distributed in this kind of format dot tar dot z but as i told you they can be both and there are some cases when you can use both of them so let me see what i have over here demo space where am i now i meant tar so now i see here that i've got already two files one is just the compact version of the demo space without compression and another one is already compact version one file but already implemented with the gzip compression on top of that and you see the difference in files and actually for a sake of distribution the common to go would be this one c a f so one notation over here some older guys guides not guys guys guides would say you that you should use something like zeta or something like like e or capital e or it was a b or something so that only reflects the all the different compression algorithms but in principle in the modern time in the nowadays that tar is smart enough if you put a over here that means that that tells to the utility itself that please please make the compression based on the on the extension of the file that you're trying to get and in case we're getting gzip so that means that it's will be zipped and in case we put here for instance bzip i'm not sure if it's installed or not but then we can get another one so you can see that i'm getting this one so but actually it's not correct so there should be some was it busy sorry i didn't test it so i don't remember exactly what was the but again we can use the manual and then if you go for the compression you will see the list of the options so that's the bzip 2 must be and then if you want to use lzip that should be lzip if you want to use lz op that should be this one so basically what i'm saying is that nowadays most of the people are just using the outer compression and so you don't need to remember all these filters to use it and the one is one of the most used is z and then minus z but anyway here you go let's try still basic too we would be correct this time it's still not compressed uh probably probably i don't have it installed on this outdoor laptop which i'm using to give the course so i have it installed on my other on my other desktop but anyway so you've got the ideas that you can use whatever you want to so basically instead of a you can put here set or g or capital g or what else was there something like something else was there as well but that is the most common since we are talking about the gzip so we can just run a and demo space okay that was the first touch and then the next one say that i have it in my uh in my directorate right here so i have it over here and there are a couple of them and then if i want to take a look at them so let me also remove those nasty ones that i happened to create but unsuccessfully okay we are back to these two so how to take a look what's inside you don't need to untie it you just want to take a look at the content so one thing to try is star minus t t means listing so you do not really untie it you do not really uncompress it you do not it save it anywhere but you just see what's there inside okay then if you want to uncompress it you can do it this way x i don't need yet another demo space directory in here but for the sake of for the sake of just testing let me do it i did okay it's already exists surprise okay and i go to the cd test five and then i move my demo space there over here so you can see it once again it's in my directory and then i can play with this without interfering with my original demo space so usually this is happening this is this happens in such a way that you translate to some other directory so that you play with some other directory and so you don't have this issue but since i am within with the same file system it makes sense to just and then i do tar and then next my it's my extraction option it's minus x and then af and then demo space now let's see what will happen so we will get exactly the demo space over here and the benefit of this tar archiving is that you are getting all the attributes of all the files of all the territories in exactly the same way like they used to be in the original so timestamps ownership permissions everything is everything is stored for you over here and this is one of the biggest because this if you for instance would be would like to do it with a copy command copy would not do it for you not in this way not that accurate it can of course save for you some of the information but it will not be that accurate as tar would do and as i will see i will show you another one commands later on how we can make a whole copy of the whole tree from one part of the file system to another part of the file system so we can use also tar for that so here is basically to take away three commands so how to compress it with the taf then how to list it with the taf and then how to extract it with the xaf for everything else if you ever need you just go to the manual page and see what's happening in there one important remark over here one important remark when you do the tar archive tar archive doesn't really remove anything from your original directory it just create another one and the difference makes sense to remember especially if you're doing something with a really huge directory and in this situation you will get the kind of you will need extra space to create this tar archive before you will be able to transfer this and that's especially the kind of bottleneck if somebody of the system administrator tells you okay get out some of the data and you start thinking okay because you are really short on the on your on your quarter on your space and then you will start creating those kind of tar archives and you end up in the situation that tar archive archive has not been created it's in the middle but you don't have a space anymore just to remember that tar does not really touch your original so nothing is removed nothing is compressed in a sense and the original is still there we will have just in a second not in a second in five minutes when we go to the next session i will show you how to do it also on the fly but before that i can't tell you i can tell you about another utility which is just the zip that's the kind of zip algorithm for compression but it's GNU zip so it's essentially the name is jzip it's also the standard default all around linux and unix so it's pretty much if you're locked in so any unix kind like installation so this will be there and along with the tar the difference between this one and tar is tar for the really directories and some directories and common structures three structures of the directories but then zip is usually used for the single file okay let's see that if i want to for instance zip my hello one what will happen will happen next that you see that before i had hello.sh and now i have hello.sh and my original one has been deleted so this is the thing to remember that when you zip something the original one will be by default deleted and so then the another one thing to remember if you want to uncompress it you go for the gan zip and once again my hello.sh is back so useful when you do it with one file and you want to go for the quick compression and just for instance somebody is asking could you both send me your stuff by email so that's easy to make an email and put it either as an attachment or you just put it somewhere on the web but again tar zip is the most common so because especially about when you're talking about this software distribution i think this is pretty much about tar so yeah i forgot to tell you so there is one option which is which allows you to go to the you don't need to make dear and path you still need to make dear but you don't need to cd to some directory you can set explicitly on the command line and so tar will just unzip everything what you want to that specific directory which is which goes after follows after the minus capital c i think i have told you what i wanted to tell what i had to tell and now transferring files so we're still working with the files if you notice that the processes they took me way less time than than the files so because of most of the time that you're doing is that you're doing something with the files and what the results transferring the files that's yet another one issue that you will definitely limit and so now i'm a little bit specific i'm a little bit specific because we're i'm talking about how to transfer between two linux systems and that's the what do i say so because if you are a windows client i mean if you are on the windows machine you can probably use something like win scp and you get access to the remote file system and you will see it as a kind of graphical through the graphical user interface and you will be able to just drag and drop from one window to another one and all the directories and files that you want to uh on the linux terminal you don't have a graphical user interface essentially but you have some other utilities and the most common for transferring utilities transferring files in between two hosts that's called the scp so when it comes down to one single file like for instance stark zip or something else then it comes down to the scp let me demonstrate it i will use my let's see that let's say that i will use the most common for the alt users kosh and i want to what i want to copy uh what i want to copy over here actually let me see what did i have this let me make once again the cf the demo space demo space and then i'm saying here that please make this directory inside this directory as well so that's a little tricky part will probably say me that something has happened but this is you that's just don't pay attention this is harmless ls minus la so now i've got my demo space is over here i can also check it once again r minus taf okay everything is there even if tar was kind of producing some kind of warnings but now i want to copy it and now i can use instead of copy copy command would be for the local copying only but scp that would be for the ssh protocol so the same protocol that some of you have used to connect to a remote server there is part of this protocol implementation this copying program scp so i'm saying scp i'm saying the name and then i'm saying where i want to copy it alpha.fi and then what's important i put here the column otherwise scp will make a local copy if it doesn't know that that's the name and then on top of that you usually don't need it but i'm just telling you to do this because if you're on your local laptop and your local login name is different then you have to explicitly say that okay my login name on that machine is that and so let's try to copy it and default directory where the demo space will go to will be my home directory on cosh so if i put nothing over here i can put some directory name if i know where to go but in case i don't care so it will go to my home directory so let me see scp and in my case it should come up quickly because i'm using the ssh keys so and i don't really it doesn't really ask me the passwords otherwise it would ask the password as well but okay the demo space has been copied um and it's there how to check it you can go to the cosh i'm ssh in there and let me see use it there well i know it's there i'm just demonstrating that okay it has been copied i go back to my normal to my normal screen that's the scp as easy as that so if you want to make a copy of some very uh just just one single file you can do it this way you can also do it with the with the directories so but then you put the say that we have some directory or what did we have inside was it there or what did we have so we had some folder scp folder and that would work as well for me i mean if i would try to make a copy of folder with the scp it will give me the it's not a for it's not a regular file so you have to explicitly say here that please make it recursively and in this case it will do the proper work for me as well so all this file for one one have been copied to the cosh but i can also show you a better choice so along with scp we also have sftp it's the kind of combination of ftp and secure ssh protocol so when i have something like sftp cosh what will happen sftp will show for me a connection it will open for me establish for me a connection to a cosh and i will be there in the way uh kind of open window that's asking to me what exactly i want to copy or what exactly i want to do so to get some help you can try common help and you can get pretty much a long list what's going on over here and then for instance i want to check where am i um cosh it's a remote working directory so that's important it's not my home local on cosh okay and then i want to check what's there okay there is some kind of documents and then for instance i decided that i want to get something let me get that particular file for instance this one it's small enough and i should be able to get it quickly so that's that easy so and then along with the ls for instance l and a so you must know here that ls for instance is just part of the implementation of this sftp protocol uh also of this sftp utility it's not the normal ls that you would use inside the bash so for instance ls would not work it's invalid invalid but again some flags will still work over here and you can get the additional help that what exactly is doing ls uh or no okay so here is this all the information which comes out right away let me see let's help no i'll forget the help there was okay but definitely you can go to the manual page but well at least i know that that's the way to do that and the tricky thing with the sftp is that you should be able to see both and your local directory and your remote directory and ls will give you the remote directory but then lls la will give you the local one essentially and so you should be able to check okay i actually i've got this one and this is already on my local directory and in the same way if you want to put something then you just use put and then that means that you want to copy something from here to there where you are right there and that's the way to kind of do the transfer between the two costs now you see that i am just logged into kosh and i did the transfer the way i wanted and i also checked it right away i don't need to make the different scp a different ssh i can use for one sftp so i definitely suggest that you pay attention to this even if this i'm pretty sure most of the people will still say your scp is something but then if you see that okay you have lots of stuff to copy and you still need to check it out so sftp is your friend and along with the sftp of course you can use it just normally actually i have these commands over here as well so you can instead of scp you can use it just like this with one single command and you don't go into this interface you don't need to really do anything else especially if you're thinking of some automation and this kind of things will be used without your interaction with you so i'm exiting exiting and i do hope that at the moment you're already on top of the how to make the archive well to transfer the file and then next one i will mention u1 utility which is over here but still very useful i mean it's at the end of the section but still extremely useful it's called the rsync rsync is the it became popular probably about 10 years ago or something and now it's became just one of the standard tools which are available on pretty everything everywhere on on every distribution of linux system and so the rsync is used to make a sync of two directories you can do something like with the scp etc but functionality of rsync is way more advanced so it can check and can go and make the only updates and for instance on all my backup scripts they have written with the rsync and i'm using this all the time so pay attention to that one and then if you are kind of keen of doing kind of automatic and backups to some remote server so or if you just want to keep in in sync some two directories one on your laptop another one on triton or some other resource that you are using then rsync is definitely your friend number one or actually number two after fcsfc so just google for that and you will find lots of example how to use rsync and then you will find something useful for you so my role here is just to mention it that this one is available and you remember at very beginning when we have started this sessions on the very first one i have shown you one command in order to impress you so my goal was at that point not to confuse you but impress and then now you should be able to read it and understand what it does actually not yet but because we are using here the red direction ah okay so let's come back to this after the next session you should be able to read it completely but otherwise you should now understand what it does most specifically it does the archiving of everything what comes my directories over here when i here put in minus that means that it should go to the uh to the standard output i will explain just in a second just in a not in a second maybe half an hour what that means for and then i'm going to the pipe to the ssh create ssh connection and on that connection when it has been established i already get everything what comes to my uh full tar to my standard input for this cat command and put everything to the archive it's that fairly easy with one single mistake that should be as well yeah because we are zipping them or you can so here you have to explicitly say what kind of algorithm you are using because there is nothing uh for tar to make a guest with how it goes but we will come back to this as well i will i promise you whenever whenever i show you what's the redirect means and how it works and how cat can be used to do the redirects so i will come back at once once more to this protocol to this tar command and we will see that how to make the tar archive on the fly and so it's some situation it will save you some time for instance you don't need to create the tar archive on your local file system but you can start creating tar archive and piping everything what comes out by ssh to your remote file system does saving your space locally okay and then let's see where we are where here we are so exercise 1.3 i guess i guess i have nothing else in between yes so exercise 1.3 so let's say that we will have how many minutes how many minutes we will have let's say that we will have something like 15 20 minutes for that 20 minutes and then we will go for the exercise and then we will have a break and actually yeah i apologize once again for yesterday yesterday i have forgotten about the last break so this time i have called myself a note that don't forget the brakes i will not this time so exercise 1.3 it's now your time 20 minutes as usually feel free to use the notes and we will reply to them as well and if there will be something that needs to be pronounced then i will also make it make it sound okay 20 minutes and we will be back at 15 at quarter to one okay let's see what was on the list so the first of all on the list there was the client commands and i was just looking at myself for the client uh manual so i'm looking for the permissions because there was something readable and writable and see the modes actually right over here i have already ready to go example oh that could be done okay that's enough for me i send it to the ground just to see what's going on now what i want to do it i want to do it in the home so home for me is still that you remember from the yesterday sessions it's that going to be the uh special character for the home directory and then it's a file then that means that i'm typing here it's a file it's also should have some kind of readable and writable by everyone so what i'm saying here is that i'm saying that my permission of this file that i'm looking for should be minus then everyone or others and that should be equal read and write let's see what do we have over here uh always ensure just for the security reason i don't have any file in my home directory that would be writable writable but let's make for a sake of just to demonstrate it so i put some others plus right and what we have over here some file test okay so let's try to search once again and now we actually got exactly that file so that's correct but then the next stage is actually was advanced level but let us do it so we can use the execution option of the find and say that okay we actually want this to be replaced and what i want here is that i need to say that everything what you find over here should have no writable access for others and we finish up this construct like this okay we are quite and then let's try once again and so my my file which was once fixed it's over here so that was the number one number one then number two make it tags up a half of any of your directory when done with the archive content so we have done it already several times with the demo space but let's try it once again so i'm doing the tar here and i'm saying here that it's going to be the demo space uh dot tar dot set and then i'm saying here that it's going to be uh it's going to be the archive of this current directory okay so now you can see that it should be there demo space is there and then i was about to list the stuff in there so listing would go with the minus taf and then the archive name so here you go you get the directory listed on my screen then extract only one particular file to a sub directory from the archive oh this i don't remember exactly how to do that uh so if i do the extraction uh as far as i remember then i don't need to know exactly what's going on for instance i want to instruct uh which one well let it be hello shell once again so if i want to extract this one as far as remember i put it over here but then do not overlap with the current one i can do it but let me just put it somewhere to the folder one for instance folder one okay let's see what happens okay and that should appear now in the folder one and let's here just the question where it has been copied what it did for me it did demo space hello sh let me do the trick forward so i'm doing this from the demo space and i'm trying to copy it over here it's not here interesting so i think it's still copying with me somewhere else demo space hello sh so it says me that it has been extracted ah okay okay i'm doing it the wrong way definitely so what i'm doing is that i'm just do it with the taf where i should have used this of course hex and f so that's minor mistake so now you see what i've done here so i do the i say that okay extraction from this archive and only this file and it should go to this folder one so now i should be able to see that in folder one this hello as i hear it no okay so i'm doing something wrong essentially i was still here folder one is still there nice okay let's go let's go through the rest of the exercise and when you have a break i will find it out and show it to you what i'm doing over here so didn't check them out just was thinking that i can do it online from the scratch the chance to just create a archive using sftp so we've done it already several times but let's do it once again so i'm doing this sftp and i'm doing this time it to say to try it on because we already try it on dot and then you will see how it goes yeah try it on as busy so login and takes time it's now connected and now i can see lls demo space demo space archive it's on my current stuff okay and then i want to put it to the remote directory demo space hard z and i'm somewhere in my home directory so it's there and simply i don't need it anymore i just do it for the sake of demonstration demo space space m okay that has been removed and i can make it okay that was just for the sake of demonstration how to do that okay now you have 10 minutes break 10 minutes break and let's get back to the things quarter past one okay hopefully you're back hopefully your legs are stretched and now let me give you one hint that i just found myself sorry let me give you my hand so i tried to do something with the tar and actually i've done pretty much everything correct except that i forgot that actually minus c it's the it's the way the more order of these options does matter so i put something like minus c it will be only applicable to the files that come after but not before so that was my mistake but now you see i'm extracting only one file and put it only also into the specific directory that i want to put it and here you go if you look at the folder one you will see that there will be created demo space and in demo space will be hello s h so that's important from the tar perspective or from the user perspective to know that tar will also will always try to not always try it but it will do it will do safety path so that's the way actually if your directory is being main subdirectory then another subdirectory your file will go there you will not extract only one file but you will extract actually the whole directory structure that well where where it used to be in the original in the original directory so now we are getting back to the next section and not back we're getting further so we are going to the next section so next section is the command line activities it doesn't really bother me to tell you already i did already several times it doesn't really bother to tell me even more that bash is it's just it's loads of utilities and the bash allows to work together so it's working as a glue in between them and this time i will just show you then we'll have a collection of proofs how it will work you see once again a list of commands that to be some of them we have already used some of them are new to you but this is a kind of collection of the those ones that you will most probably meet at some point if you will be working with the bash there is more actually the amount of the the amount of the commands on the bash on the on the on the linux that is just the there is no pretty much well probably there is kind of limit but i mean there are hundreds of them and every single instead every single package that you install will bring you even more binaries which can be used from the command line but let me point you to several of them actually of those which are here i have named a few that i would say would be most useful would be most useful for the for the daily use so here is some of them i will explain them one by one where we will be going through the examples but then what i definitely suggest to you is that i have put here the link to the cheat sheet it's the on the notes and if you click on the cheat sheet you will see the kind of ad4 with a very brief description and examples of what is what and what is what is doing so but the best way is to do it is to do it with the examples so one example that we have already seen is was the disk usage and i have reviewed it already several times and you can actually write it down for yourself so the best thing is that one of the instruments to use between the commands is to use piping so let me explain what's happening over here first of all we are running the disk usage command and telling it okay produce us the result and in the human readable format and we need this the sizes of the all the territories and subterritories including those which start with the one dot when we send everything to the standard output and then we pipe it then the standard output is picked up by the command sort and again we are saying here that's the format that comes out that's the human readable and then we pipe it once again and we get the pipeline which finally we get this we pipe it once again to the tail and say that okay we need only 10 last lines of the output so that's a perfect pipeline or that's a perfect one liner so this message over here is harmless it's simply because we don't have the old files over here we can touch one just to have and to get our do not get this error so that's perfect that's one of the one liners that you may think you can use it anytime anywhere so easy when you have some problems with the quarter with the space you come down and you just run it and check it out and you are done so another one thing that i really like is like vc vc is a counter it counts everything for instance if i want to see that all the locked in users well this case it's probably not that huge but i can still counter lines if you're on course run it as well and you will see that what's going on in there and how many users have been locked in it's actually one of the a good kind of task a good kind of problem for the exercise that if you want to try to count the number of locked in users and even make a kind of list of unique users because some users may have a couple of sections sessions connections so that's a good thing for the pipelining on the bash so let me try one thing i have prepared one single file over here that's the finished university students csv format you can cut it and see what's the inside so that's very simple it's a year then organization number of students male and female it's just a dummy format i mean the numbers are realistic from 2018 but i'm using it just in such a compact way for the sake of demonstration of the bash utilities what they can and so let's say that i want to get only some parameters out of this and so one of the comments for myself that can be useful can be cut so when you cut something that's the and then you say explicitly what kind of delameter is used so in my case that's going to be this semicolon and then i'm saying specifically what kind of fields i want to get out of this so imagine that cut rule online will just within the program will cut them by column and they say that i need number two for instance and then the total number of users total number sorry of students so i'm here putting here that give me back two in three no so the file is still missing so file finished university students okay that's the output nicely looking for instance we can easily and make it even more nice they're looking so if we use the column and say that okay do the evaluation and they what's we need to put also the separator over here the separator once again will be this semicolon and so you can see that actually if that would be in this way that would be looking that nice but it doesn't look like nice because we are having this kind of comments in the csv file which we want to get rid of how to do that so now basically we are starting building the pipeline over here using the utilities that we have so to get rid of the some line we can use grep grep with the negative option minus v and then we say okay so that's the grep minus v and then we want to say that we want everything but so and we pipe it then but everything but that would means for us you will see this comment pretty soon up there it's everything which is not started with that we started with this equal sign okay so now we've got rid of this first very first comment from the file and our final list is looking much better what I can do else so if I for instance want to want to get something which is sorted out for me so I can also put the sort function so for instance I want to sort it and I want to sort it by the number of students and then that means that I can't I should also put here the zero meter what was it semicolon then I want to say that my fields to be sorted is a number which one in this case that's going to be number two and is it correct I guess so and then okay what's wrong here is that the sort command doesn't know that it should be numeric this because the number the field number two is actually a number okay now we're getting much better and we can even tell to the sort that to it in the cursive way so put the output the biggest one first and so here you go and we get the number of users sorted this way while the command is already looking like this it's pretty long pretty long and then we can still go further and we can say that okay we actually only want to see the top five and we can see that okay give me only top five from the from the list of these lines okay and by the end of the day we can even give them all a number okay and so you can see that actually that's the way to get these commands to work together so first you know what the command does so that you know where to find the information about these options and third you just do the right order and put them in such a way that you are getting the results the way you want to it's quite common in the bash scripting that you are having some kind of output from some kind of program and you just need to grip and format and structure them somehow sort them somehow to make it to make it more readable or more understandable or more compact or etc you continue the list so that's one of the things that I wanted to demonstrate you and then let's go further and one more thing that I would like to introduce you was the redirects so we have already seen this sign more or less the signs which are quite common but from the bash perspective it's not the RF medical sign but it's the redirection so when you see something like this command then redirection and then the file name that means that these output of this command will go to that file and you can see in other words in other situations when it's doubled so what's the difference between them is that in the first case you will replace that file txt and if you double this sign you will just append that file so basically the content of that file will save but at the end of that file you will add more and then there is another one thing it's the standard input so let me say yet a few words about the standard input and output so that's the thing that you probably need to know and you will know anyway so at some points or every time when you run a program or a commands bash will by default will create for you also the standard output standard input and standard error streams so and streams can be manipulated in a sense that that's exactly what we are doing right here we are redirecting the stream so we are redirecting one to the file when you do the when you deal with the standard output or you can also redirect file to the commands that's also possible so in this case we are using the redirection from the standard input and the only difference is that here that actually your program should be aware of that so if for instance a standard output can go to a file in any way so it's a program even doesn't make the may not know about this but in the in case of standard input if you want to try to redirect something to them then the program actually should be aware of that so that should be realized on the programming level and so that means that not all of the props can do this and we will actually work way more in detail with these concepts during the shell scripting course so that will be I will tell you well more how to do that and how to write the scripts using these redirections as an option but let's go to the example let's go to the examples like try the first one you remember we were opening the file with the nano and we were adding the some information over there but you can also do it in such a way like over here you just simply execute the command like echo for instance and just do the simple redirection to the whole world and what will happen over here is that file if it does not exist it will be created and if it does exist it will be overwritten so let's try it and we let's put it this way and I still redirect it to the same file and you can see that actually this has been read overwritten and let's see what will happen if I double the redirection side you can see that this actually has been appended so the new line has appeared after the content of already existing content so that's the difference that's the way to remember that let's play with some other utilities so let's make a few more files over here so we are creating file abc and let's create the file xyz so that will be a tool so you can also list them both you remember we can use the brace notation so both of them are here abc xyz so one thing to play with would be join them together it's that easy you can do it with the cut command and redirection and creating the new file and you can see that file will become like that so they already joined so these are not two different files but these are one file with the content of the both of them okay that's our coordination can be done then the next one so truncation truncation very useful command if you want to work with the files and when you want to replace for instance some parameters some characters with another one so what I'm doing over here is that I'm saying that every single space so I'm here saying that my first character space needs to be replaced with the new line so basically what I want to get I want to get that every single letter abc would appear on the new line and so I'm saying here that my I'm redirecting the contact or content of the file one to the commands and then I will redirecting back the output of that command to the file four and let's see what will happen and we will happen next file four will become like abc and file one will remain like that so there is the alternative which often used so I would say that people often ignore this opportunity to use the standard input redirection and they just use the pipe for the cut but the effect the result is exactly the same so you can see that we can do the same for the file too so we just output it we pipe it to the truncation command and we redirect it to the file five and let's see what happens what we get with the file five you can see that the result is exactly the same like in the first case so these are two alternatives but you just must know that they both do the same then let's say that I want to introduce you the paste command so we have two files two files and then I want to join them paste one to another one by line by line that's easy to do with the paste and so let's see what's going on with the file six so you can see that actually we have used the delameter the separator like column over here we are saying and then we just join the lines one by one in the same way if you would like to have something else like delameter I don't know it could be just the some other character or maybe just space and then you can find that file seven is actually looking like this so and on top of that there are others I'm not now going into the all of them you will have them from the cheat sheet you will find them on the manual and you will find them while you are will be going will be diving deeper and deeper into the the only thing actually yes I want to say this one so def null it's very important and very often used on the command line it's a special device def null everything what you are redirecting to the def null just disappear and so if you don't want to see some output of the command so let's get back to that disk usage where did I have it uh disk usage yeah and you remember for instance in case I would have no or the I would have no the this dot file dot file is there but let's say that I have no dot file and you remember we've got that error message that you cannot access because it doesn't it's harmless it just doesn't find any file would would start with the dot and it complains over here and we can easily say that okay we don't really want to see this so we've got you know so now I'm explaining what has happened so now we have redirected the standard output but I said you already that there are three streams every single one process will have three streams one is standard output standard input and then the standard output for the errors and they all will have the its own file descriptor don't go that deeply yet but just to remember let it be just a stream for you right now and you can redirect them in a way you want to and I'm saying here that if I'm redirecting the stream number two then bash knows that I'm talking about the error messages and bash knows that if I'm redirecting the stream number two I don't want to see the error messages and you can see that even if we still don't have this dot file the error message has gone so that's the beauty of redirections that's the beauty of the streaming of having the standard input standard output and standard output for the errors good okay now you should be able to understand for sure what's this command is doing so that's what I was trying to push you already recently but now but now let's go for it once again so I will redirect it to the standard output and let's say that I want to do this my demo space once again my demo space once again and then I go to the kosh and I have my login name to the kosh and I have my name over here kosh out of the file I'm in the not my name but in the name of the server which I wanted to contact and then what I'm doing over here is that I'm sending everything what comes from tar let it be in the correct syntax as well the demo space and I'm not having here an archive name but this minus says to the tar that everything what comes should go to the standard output and that means that pipe will just redirect everything will pipe everything the correct word would be there we're looking for the state will pipe everything to the ssh commands and ssh is smart enough to realize okay it's something that comes from the standard input and let's see what the user wants to do with that and we will run cat cats on that server already and cat is smart enough as well so it knows that okay something is coming through the ssh to my standard inputs what to do with that okay we can actually use the redirection and we can use the redirection and we can say that this redirection should do the should create the file so basically what happens over there is cat is doing nothing that just putting everything what comes to the standard input to the file and it happens that this standard input is nothing else than the output from the tar and so that's the way we should actually say that this archive should be become the stark set so let's see what will happen I will run the tar I will run the ssh and no errors I've seen so far if I go to the cosh and let's see whether my file that I have created just now is there oh it's there and let's check that actually it's the one that we expect yes and file tells us that's the tar archive and let's even more let it be even more kind of suspicious and let's see that's what exactly is there is it correct one yeah it's probably correct one so now you have one trick more in your pocket tar thing with the ssh and so copying everything from one computer to another without any tar archive on the local drive that will help you hopefully that will help you at some point to save some space okay time for the proximal I have another one for you so this one will be was one of the that from this section so let's see what you know what you remember so we'll look at these ones at the questions and try to try to realize so you don't have multiple choices it should be only one so just as a remark to you because we did this already several times as a demo if you were listening carefully so you know the answer somehow proxima doesn't show the comment itself but you can see the comment on the on the shell will do your choice it doesn't mean that if majority is answering one is true it's true it's taking one option it doesn't mean that always right just think carefully okay 10 seconds more so think about this and we're still waiting for whether it be at least something like 15 magical number this time to keep going and we are already very close to the so the actually not the break but before we go for another break I still want to check you with you yet another section the grouping one so one one one more reply and we will go through okay so let's see so that was the program that was the commands what's happening over here so we pick up the file name named file name one we just output everything all the content of that file and we pipe it to another commands so actually to the file name number one happens nothing except that it's being read and it's being streamed to another command so we crop it this command grabs the standard inputs and it sees this okay so we have all the single spaces needs to be replaced with the new line character and then one one it will do do it just line by line and then whenever it's done every single line will be outputted to the file name too so the majority is correct so that's the the last option over here okay so grouping before you actually another one interesting examples I don't remember where from I grabbed it but here I can't think from going for this one as well so you see what's happening over here so we are getting the newest file so essentially it's a bash history because that's the newest based on the modification so the newest one it doesn't mean that it has been created but when it has been modified recently so what's happening over here again this kind of new liner as usual we start building from the from the very first command so first you get the list of files without any specific specific crap like meta information so but here is we get it also sorted by time it's already something but still we need to make sure that actually no one of them is a directory and we can do it with a grip we will come back to the grip recently in just a second but here is one option so minus v means negation grip and then minus capital e that means that it's the advanced mode of gripping so where we can use already regular expressions for instance and here we exactly do the regular expressions and here we are saying that it will not start with either it will not be either something with a slash in it or it will not start with the dock sign which means that it's the link in this case not only the link it's also it's us well it's not the link it's something else i said yeah it's actually that means that's a link yeah exactly so that's already enough for us so we grip out filter out the directories and links and then we want to have only one single file and here we are saying that it should be only one so the nature it would be like this but had also accepted this kind of syntax and so while now we are getting the file which is the newest one in the current directory sometimes it's useful for you so feel free to pick it up we can also pick up for instance the top five of these files and see sometimes when you're doing the changes so something has happened you just want to see the files which have been notified recently okay grouping grouping is somewhat i would say that's already advanced information but i still thought that we probably have it on this part of the course curly brackets then the command names and then the file name so what do you need to remember for instance i do the ls l yeah on my list or just ls let's say that i want a list of my directory l and i want to even say that do you do it one line one line at a time and then for instance i'm making a snapshot but i want to also have a date so i put a date and then i use a separator separator on the line is semicolon so everything what happens before they sell a common white bash is considered to be one command and everything what comes up is another command and then another command and then there can be another command etc so the commands can be as many as as you want to what will happen this way so i see that both commands have been executed date first and then the output of ls nice uh actually let me use even the previous one so that would be also a little bit more useful so now you see that i've got the date and then the name of the file name of the file which is the newest one cool but what if i want to put it into the file and i want to probably like when i'm doing this snapshot and let it scroll exactly like snapshot and what will happen over here that snapshot will have nothing else except okay so there's the file which called snapshot so that's my way okay let's do it this way so now i have two files to go and then or let it be this way so i do still want but then i create it to the upper directory okay complicated it for myself but anyway here i do the explanation so in this case this redirection will be attributed only to the last commands but not to the both but i still need both if i would need both i would probably have to do something like this date snapshot yes and then the command itself snapshot and that would be even looking like this because i need to i need to be able to not overwrite but authentify and so now you can see that actually this is pretty much what i wanted but the structure i have it written a little bit ugly a little bit complicated and i definitely don't want this kind of snapshot to appear everywhere and for this situation we have grouping so you put the curly brackets over here around the around the commands spaces in between curly brackets and the end of the command are important that's the first remark over here and then the end of the command is also important otherwise the syntax will be wrong and bash will give you the error message but what happens over here is that since these commands are already grouped the output from both of them from group of the code will go to the snapshot and so you can see that actually this has been updated and both outputs from both commands are over here so that's one thing this will happen within the same within the same bash session there is another one option you can actually use the parenthesis if i pronounce it correctly and in this situation you will actually run another one bash instance why it's useful it's not that useful in this case because it doesn't have too much of the stuff to do but let me show you one example which you find useful quite easily so there was the example with the tar command so for instance i want to make a full how to say a full copy of the directory tree copy cp minus pr whatever it does the job only halfway but if you want to do it properly you can do it with the tar and there is a tricky way so for instance my current directory should be sent to the pipe to the standard output and should be piped to another tar but it's not that easy so i still don't want to tar and untar within the same directory i need to come up with the idea how to change the directory within the same pipeline and the tricky thing here is that you can use this pipeline parenthesis and it will give you the thing that you can actually city some other directory and and if everything is correct let's let's be not that far away you can just untar everything what comes to you and it will go to the to that to that directory so maybe this stuff is a little bit complicated for you right now but then at least i had in mind that i should have told you that this kind of option exists and then probably at some point when you will be at at some kind of deeper level with the bash you will find it useful as well but anyway here the grouping commands but the message to take away from this section that there are two ways of doing this so with the curly brackets and with the pipeline physicist and the difference between this one the later one will be will create an external bash processes for you and you can do pretty much everything within these processes without any interaction with your current session okay and then another one thing that i wanted to tell you is that because i already told you about the couple of strings you remember standard input standard output and standard error output what that means that means that you there is also techniques how to join the standard output and standard error output and the principle is called if this is the redirection of simple redirection of all the standard output then adding the ampersand over here will do the redirection of both so let's see how it works if i do the lsla and then for instance if i do the file what's the file one yeah or file seven it's exist and redirection will go to the seven meta information for instance we're getting some meta information about file seven doesn't make much sense but it only makes sense for a seiko demonstration so here you go okay it's in the file but what will happen if i will somehow try to list a file which does not exist for instance i will be getting the error message and this essentially this file itself that i'm trying to create does not exist or it does exist but it has zero nothing came into the how to do that how to actually output everything what i want there including the standard error is to add the ampersand over here and so in this situation nothing will come to my screen but everything will go to the file eight and also the error messages so that's the thing that you may think about in the same way you can use the piping so piping like this will send only the standard output but piping with the ampersand will also pipe the standard error output so all the streams will go away so use it when you need it quite often you need this but let's see that i can come up with example for instance that i'm having right here it's pink so when i want to pink something i want to pink for instance the google dns so it's 100 time up on 99.99999 up so you must be pretty sure that if this guy is not up then something will be on network okay and then if something happens i don't know maybe for instance let's imagine that it doesn't work i mean despite it doesn't exist this is why it will produce their message so now you see that actually you are not interested you're not interested in the error outputs so as i told you previously you can say just the just the error itself or then you can send both of them at once sometimes it's useful and let's keep this comment in mind we will use just bullions right after the break so let's have 10 minutes break and we will get back to the to the material at 10 past two o'clock and then there will be gripping there will be evaluations so there will be this kind of basic conditionals that can be used on the command line and then exercise another one and then let's see will we have what how much time we will have for anything else but anyway it's the break right now and we back we get back 10 past two okay so the lips are ready to i mean the brain and legs are ready to go further so evaluations separators and the grip commands i picked up the grip i mean if you have seen if you have noticed during the whole course that i have picked up several of those utilities like tar like what was there i find there was the association and sfcp there was this there was something else okay but anyway so these are the these were the commands which are more or less common and you can find on any installation if you go to the linux and they are really useful so a gripper is also one of them but before we touch the grip let me also do some explanation about the other things so to some degree everything some things have been already covered and probably explanation will not take that long but one thing that i would like to say so you have online when you are doing something how do i say this so every single command has a kind of written code what that means that means that if something happens and it happens correctly so for instance i'm doing ls minus l so i don't want right now the output i just need to be needs uh want to want to get the just want to get the the last last command the last command return code so this return code can be seen with the echo dollar sign and then question mark and if it's zero then as opposed as opposite to many other programming languages in bash that means it's positive so that means success okay let's see that i'm trying to like last time at least something which doesn't exist so essentially command should end up with the error an error would come but along with the error it would come non-zero return code so this guy which is set after execution of the last command will be always the return command after the completion the return code of the command after the completion so and then on top of that on top of that if you are the words so the new relation over here makes sense so in principle if you know it if it's not zero then that means that's already some problems but then how exactly these problems can be addressed it's already up to the documentation of that particular program that you are using so this error messages this error code can be somewhere explained or maybe not i mean if it's the easiest one you just put that the error code is one and that only means that's the error and something went wrong and then if everything went okay then that's the zero and that's that's fine okay so that's a thing to remember because the next step we need to have conditions so what's the conditions these are kind of boolean operators double one percent and double pipes but we don't really call them double pipes or double uppersons we just call them okay fails true and fails so what that means you put double uppersons after the command execution like for instance in this case and you say in other words if the exit code is zero then execute the next command and i can say for instance file exists we will be this way yeah you can see that nothing has happened when i'm trying to file which is doesn't which does not exist but if i try the file which does exist this command gets executed that's the whole idea but you can even do it better so you can put all of them on the same command so and then for instance you can say that it does not exist and let's see what's happened if we go for the file which does not exist so what that means for us that means for us that it opens the doors to make this kind of small one liners and do the check so one check in particular that i loved a lot so let me see that what i can do with the pink so let's say that we have a pink yeah we don't want any output from the pink but we do want this kind of construct so i copy it over here and i same here that okay if pink goes through we are online yes and if pink returns me something which is non-zero i want to say that we are fucked no we are offline sorry we are offline so at the moment i have a connection one point one but let's emulate the situation when you don't have a pink so i don't exactly cannot really stop the google venus or anyhow but i can emulate that i cannot ping it so for instance i put here the wrong ip address and voila we are offline so that's my very brief but i would say that's very fruitful inputs on this on these booleans so what we have over here can be used pretty much everywhere and now so what to take away a message first of all that every single command will produce some some error code that's the part of the bash it's not even part of the comment it's part of the bash and then you can use it with this booleans negative true and false so this one stands for 200 sense for if it's okay and two vertical lines two pipes it stands that it's logical no so it means that it has failed somehow i don't think i have anything else to say here so the thing is quite simple and you can also see the over here the description and also i have said already previously about the semic column which is the side writer on the line then let's let me introduce yet another very unique sick program which is called grep and later on you will certainly find it useful i would say that's cat grep with that tool probably that you will use most often when you are working with the outputs and the trying to get the output of some other file so the grep is simple but complex so in the simplest way you just put the what you're looking for and you put where you are looking at you can do also with the commands and redirect everything from the command to the grep and again search with some kind of search word over here but then how you prepare this one and how do you search it that's already already a little bit tricky so let me say that what we have over here so i have this finished university wow and let's say that i want to grab everything that would have for instance julio pistol and then let's i want to grab something which will have oh that's the easiest one that's the easiest one but then let's go further and say that i want to do what let me say that i want to do both at once and then i will i would like to use the expression like this so for instance i say here julio pistol as well and i put the pipe over here and this is already the which comes with the situation okay that's the probably the either of them can be part of that line that i'm looking for and so you are getting both of them then you can use something like for instance if you want to do the case in say intensity insensitive then you put the minus i if you want to look for the special word only so if you are looking for this word separately it's not part of the word so and you can see this has been limited for instance if i previously tidy your pistol was also on the list now it's missing because i'm using this minus v so i am saying that exactly this word or this word should be separate one uh what's what else so now i want to say that for instance this line that i'm looking for should be i don't know say that you remember my grip that i'm using that i was using previously and let me just say it once again so there was this comment over here so i want to see everything except that comments that comment line so what i'm doing over here is that i'm using negation minus v and then i'm saying here explicitly that actually anything which would start so this hat stands for the beginning of line so and i'm saying here the beginning of line cannot be this equal so equal may be somewhere in the in the in the text but not the very beginning of them so and now you can see that actually i am outputting everything but not this one and so i have also some kind of empty line over here so i don't want the empty line either what i'm saying here that okay let's use the regular expression once again and let's say that another option that except i don't want comments i don't want also the empty line how to say the empty line empty line would be it will start and will end and in between them nothing so that means that's the empty line from the grip so now you can see maybe that's not the empty line now we can see that what kind of plan is there there is another one utility cat well utility is the same but another one option for that today is the minus capital a which will tell you and will show you what exactly is the is the what's the hidden number over here and so in my situation the hidden number over here is this m so and if i want to get rid of that what do i tell so i need to get rid of that as well first it's some special character which i don't remember which one is it i can use it with a truncation later on let's say i don't remember it right now so what's the special character for that was but it just just let's keep it for a moment i put it for myself to remember how to replace the special character and get this one out okay let's continue let's don't get focused on this one i'm pretty sure that must be something simple over there so what's the pattern as well so exactly one for instance if you are looking for something and then you want to see only only only only only only the pattern itself so you must put minus all and actually if you go to the grep manual page you will find out then how to build very complex syntaxes like for instance if i have a few emails here is one of the example if i have a few emails then what will happen if i want to grab only the emails from the final list so let me let me do this example for you so for instance i have a list of stuff list let's call it this way beam stuff lists and i'm starting to create you don't need to do it like now you will just see it on my demo space in the on my web page but so the problem is over here that for instance if i want to create some user alpha dot if i another user a user google gmail gmail dot com then then and i call them like this and let's see what will happen over here so i need to grip the email addresses only so i'm copy pasting this one from the stuff list and what will happen so you see that my list is actually it's a little bit more than just the mail list it's also the name it could be something like addresses maybe the telephone numbers etc but here the grep is giving to me very complex regular expression which you will definitely find useful when you start building them on your own with the regular expression it's it's another world i mean you can spend hours if not days or weeks building them and seeing that how they don't work and there is a sexually joke also about this that if people think that they can solve the problem with the regular expression then they definitely they just got another problem so build the correct regular expression so but here just the explanations that's already the working one to explain you how it does so i'm saying that okay i'm going to use a regular expression then i'm saying that it's the case intensity and sensitive and then i'm saying that i need to get only actually the match of the grep and not the whole line and here i'm building the regular expression for the emails and so i'm saying that this one will start with some space or with some limit with some millimeter and then i'm saying here that it should be alpha numeric then it could also be dot dash percentage plus minus so basically everything and then i'm saying that any of this or any combination of these characters can be then i'm saying that's the the oxide and then i'm saying how the domain should look like it's complex but that's the regular expression and for those of you who's been doing something with the python with the pearl or even with some other languages so you already pretty much familiar with these ones and the uh marine popper purpose over here is just to demonstrate you that everything is actually possible okay uh but i think i'm i can't really tell you anything else or it doesn't make much sense to tell you anything else i would like you to try it out and to try it out let's go for the exercise and the exercise is 1.4 it's a little bit easier than usually but uh let's see what we are up for i would say that we should have enough for this 15 minutes but then we will have also the person open and you will be able to click and say that at what stage you are okay so the exercise is yours with exercise exercise 1.4 to what 15 minutes so it's going to be 1445 and we will be pretty much at the end and so i will see that if i will have two or five minutes left to tell you about about the condition about the initialization files okay well we need to keep going just to get finished in time let's see what we have here on the exercise 1.4 make pipe that counts number of files directories you can keep doing while i'm speaking and that's if you're interested just take a look at the screen so we know and actually yeah there was one thing that noticed that i haven't changed the bash history so most of the comments that i've used in the yesterday's file yet so just to let you know they are not and they are not forgotten anywhere so but i have just switched back to the to the right there okay so the make a path that counts number of files directories so you say ls and you can do it with the l or you can do it with the one which just give you the list like this and then you can count them with the vc and in order to count the lines that would be vc minus l okay and then if you're also expecting to get counted with the those dot files this construct that i have shown already several times you can use it in a way that don't and then those ones as well so you can see that actually there's no these dot files but even if there would be let it be once again remember have to need one so here you go that's the way to count the directories and the files including dot ones oh okay what's the next grep directories out of the ls minus l so we have to find out what's the difference what differs the directories from the files so difference is comes over here so all the directors they start with the d and in other words i can say that okay i need to repeat and i need to say that my line starts with the d and this can be said but this hat once again we have used it already over the demo and so here you go with the several directories that we have grip all but blank lines on the mancat grip okay and then we would say that i want to grip all but blank lines so i use negation and then i'm using this one that i have told you already so now we have got rid of the everything except well basically we are just getting the text only and all the empty files have gone okay what's next using pipes and commons echo trunk find double words out of my do-do-do list word this i don't remember except for how to do there was a mess so what do i do here so first of all i would like to make them one word per line so this you know how to do already and i do the this way so no i cut not cut echo echo echo let's see we will be able this way to do okay we don't need the don't need the notation at all so we've got this one and now we need to use the unique unique and then what's using pipes and commons echo unique find double words out of okay unique but then we actually want to find the double words i need some money unique i don't remember what was the option for that paint all duplicate twice it's minus d okay here you go so that would be the correct one echo unique minus d okay you are on the multiple system user multi-user system count unique locked in v users gives you a list of the kind of login users many of them have several sessions open commands to discover cut sort vc so now i need to go to some other guy oh for instance okay i'm looking at the number of users so i can use the minus h so in order i want to just get rid of the idea so now let me count first how many lines all together then i want to cut only the first one how to do that is that i set cuts and i put two millimeter space whatever it is and i said i only need the field number one so here i'm getting the number of users now i want to sort them just normally because that's the just letters so i can sort them like this and then i can use the unique commands and i can see that i will only get the unique entries and now i can count them once again so actually you remember there was 80 something now it's only 45 so that you can see that actually many users have double sessions but unique of them only 45 so i will copy it over here and so that you so that you also see that it's it's going like this so it will stay also in the in the bash history again the last one was kind of additional command that you can leave as a home exercise for yourself we have seven minutes to go but i still have something to tell you so you are doing pretty much uh else online but then sometimes sometimes you want to put the environment and want to keep your environment forever for instance you have set some variables for instance you have set some something like you must you have defined some aliases you have defined some functions and you want to keep it how to do that it's easy in every single home directory must be such file for instance for the bash that's called bash rc or the other option is bash profile so one is working when you are logging in normally through the graphical use interface another one is working when you are logging in through the ssh only but most often one is a symbolic or hard link to another and so these are just one file in the most cases and you can do it also as well so you don't if you if you really don't want to don't know what you do and want to distinguish and then just make them just one file but then the thing is that everything what comes to the to the bash rc will be executed and sourced every time when you log in and here is my one it's pretty long so i'm using lots of functions which have been written in the functions we will be writing later on but here is an example to tell you what can be done let me say that i won't as well redefine the u mask over here and say i can't put it anywhere i will use just normal comment and say that i want to use the new u mask which will be executed every time i am doing this so it's the what was the standard u mask for the members we have defined it somewhere in the files and directories so i remember there was the modification u mask u mask u mask u mask u mask it's 0 to 7 0 to 7 and since for instance i don't want to give anything to the any permission to the to the group once i can i'm paranoid i don't really want to share my information with anyone so i can't put it no 0 0 so what that means that every time when i log into the system this u mask will be redefined from the default one to this my new one and it will happen to every single thing that you are doing and for instance i was about to give it to you as a homework and so i go back to the bash rc so i was about to give it to the to you as a homework you can play with the ps1 ps1 is a variable which defines you how your prompt will be looking so this is something that you can take away right now and change it so for instance i do it this way and you can see it has changed a little bit yeah so in order to play with that you can go to the man bash and you can see what these parameters stand for and how to change them back and how to do what so but the only thing that i have changed it right now over here but whenever i open a new session i will still get the new one and for instance if you played with that one and if you found something that you really like you can put it back to the bash rc file and it will be your prompt forever since until the moment you will change it again okay we have two minutes to go but i think i will not say you anything else because this already has been spoken in the session number one this already has been given also somewhere previously and this one i will leave you to you as a homework so otherwise i mean if you want so you can stay for 20 minutes long long more and try it or just do it on your own my only last my only last request is to give please some feedback before you left exercise let's do it this way exercise uh no this one uh estimate the lecture material so that's the quick feedback over here uh but then if you have something advanced please don't hesitate to put it in your feedback course and this is actually even some kind of guys it's overall was very good and useful that's enough for us that's a good sign that we are doing the retro but then if you found something which wasn't we are enough or wasn't something enough then just let us know that's definitely good for us we will do the improvements for the next time otherwise thanks for coming for the course and hopefully that was useful for you and hopefully you will find it somehow useful for your future career


Alrighty! So today was a truly exciting day. This is a really long video. The first little like five minutes of it is going to be me explaining exactly what's going on at Canada's Wonderland because boy are things accelerating. But nonetheless, obviously as you can tell on the screen, Behemoth was testing, but other rides were testing as well. So I'm going to talk about the construction update at the beginning of this video because woo! It's taken off and then we'll move into just the rides testing. I'm going to put some cool music in there for you guys so you could just see all the rides testing. So watch the whole video because you're going to see Wild Beast, The Fly, Behemoth, Skyhawk, other kids rides, antique cars, helicopters, Lumberjack, like more, I don't know. But nonetheless, lots of testing going on. Behemoth was heavily trimming so just a warning it looks like it's going to be a heavily trimmed season. It's still a little cold but I was kind of like woo! That ride's moving pretty slow. So we'll see what happens with that. But nonetheless, a lot's going on. So we knew about a few buildings like you're just by looking at the thing but there seems to be another new building being built as well right next to Skyhawk. I don't know if that's going to be a cashless thing for Skyhawk or not Skyhawk, a slingshot. But they tore down that really old ugly building that was next to it where you had to go buy your tickets this last season and it looks like they're going to put a new building. But as you can see they're going to have an under kind of like ground patio by the looks of it underneath this restaurant and the walls are starting to go up. But not even that. Look in the distance there at the where vortex turns towards it's like turn around. The refresh station is literally ground up now like the walls are going up on it. So I expect the Cookie Witch place or the restaurant or whatever it ends up being to be going up as well sometime soon. Wonder Mountains Guardian was testing again beyond the lookout for Wonder Mountains Guardian because we're hearing some rumblings through the grapevine. But nonetheless lots of rides testing here's the restaurant there's the Coke refresh station is my prediction it looks like the same as all the other ones a rectangle. And yeah so more refresh stations if that's what it ends up being are totally welcomed. Again they work on weekends if you can tell the construction crew vortex was not testing I'm assuming it's pushed back to next weekend along with Leviathan Leviathan did not run either. They did have a train in the station so I wonder if they still went through with trying to like pre-train everyone. But yeah really exciting as you can tell the restaurant is as the concrete like dries or cement I don't know the right wording I apologize I know I have a lot of people in construction that follow me now. So feel free to correct me in any poor terminology down below. They are still working on International Street there's the foundation for a new building by the looks of it that's going to replace that like kind of kiosk thing that used to be there so they remove that ugly eye sore. So it's really awesome to see Cedar Fair just kind of like as I said in previous videos whenever Cedar Fair goes in and does something they always improve the area around it it's one of my favorite things. It seems like Six Flags does the same thing now but I just love when Cedar Fair announces things because you know that area is going to receive love it's not just the ride they're building they enhance the whole area and you're seeing evidence of that right here like you're getting the restaurant it's not just the restaurant you're getting a Coke refresh station the cookie witch enhancements to Wonder Mountains Guardian and down by Slingshot as well so and look at the amount of brickwork they're going to do all the way down so I just I love that it's a large chef's kiss large enhancement to the area so super excited about that can't spill anything about Wonder Mountains Guardian yet but yeah here's the testing footage have a good one guys bye it won't leave my friends hey get out of your comfort zone it's a blessing in disguise get out of what you call home your name is written in disguise


I'm Dr. Brian Gerhardstein. I'm a neurologist at JFK University Medical Center. So I've been practicing for over 15 years now. My area of focus is headache, so I primarily work with headache medicine. My father was a doctor and my sister and so it's kind of runs in the family, but so I think I knew I wanted to do that at a fairly young age. I look at neurology as kind of like being a detective. A lot of people will send patients to us so that we can figure out what's going on and it's always been an interest of mine to kind of figure things out in that respect. So it's actually a fun field for my headache. Medicine is actually a very interesting field in that it's very treatable. The ability to treat headaches has become much easier in the last 10 years or so. There's introduction of so many new medications out there and a lot more specific medications that are targeted more towards certain headache types like migraines. The nice thing about headaches is that it can go from a very devastating process to being something that's manageable and being able to help treat them and give them a better lifestyle is very rewarding. The goal for the future is to have a headache free society on how long that will take, but it's something that we kind of work towards.


So I said to him years ago, well, you invested cases for the British government, like what are your top cases? And he said Reynolds from Forrest, 1980, December, was the landing of an object that the officers came up and touched, crazy case, and Calvin, which happened in 1990. And he said, I said, tell me about this Calvin, he said, well, there were two hikers and they, it was August 1990. And they were hiking up on the hills in a little town called Calvin, C-A-L-V-I-N-E. And apparently they were illegally poaching, but that's another story altogether. They came upon a sort of disc or diamond shaped object that was hovering about 200 feet, which would be what, 70 meters, something like that, off the ground, totally silent, large, and they didn't know what they were looking at. I mean, they got some cover under a tree, they were kind of hiding out, freaked, what is this thing? They really didn't make any sound, didn't have any air disturbance. And then one or two Harrier jets came in and flew around it, at which point the guy, one of the witnesses had a camera and he took a film camera and he took six shots of this object as the Harrier jet went around it. Moments later the object, according to the two witnesses, accelerated from here and went straight up into the sky at an unearthly speed and it never made any noise or caused any air disturbance and the jets were gone. So they arranged to have the photographs taken to the local newspaper. The local newspaper was going to run the story with the six photographs. They reached out to the MOD and the RAF for comment, hey, we're going to run this story on these guys that claim to see this thing. And could you give us a comment? And this guy was the Royal Air Force press officer by the name of Craig Lindsay. And the reason why we know this is because this guy, David Clark, is an extensive research on this case. Thank you, David. David Lindsay says, well, how can I make a comment? I haven't seen the photograph. I haven't seen them. And the local paper says, well, we'll send you one of the prints. So they did send him this print and it was August 1990, sends the print off to this guy, Craig Lindsay. And he says, wow, okay, this is interesting. This is not your typical UFO report.  I mean, this is exceptional. So he somehow the MO, so the RAF, he starts to look into it. He contacts the Ministry of Defense, the Ministry of Defense steps in, tells Craig Lindsay at the RAF, hey, we got this, you can step down. And so at which point Craig Lindsay had already met with at least one of the witnesses and possibly both of the witnesses and interviewed them. Okay. So he got their account. He's got a photograph. So Craig Lindsay is now out. Okay. Now the MOD steps in and they get all the photographs, the story never goes to print and the witnesses vanish. So I'd heard about that. To me, it seemed like a clear cut story that it was covered up. And I said to Nick Pope, where are the photographs? He says, well, we had one of them blown up in this huge poster on the inside of the MOD office where we investigated UFO reports. I said, well, what happened to that? Kind of like shrugged his shoulders. I don't know, you know, and I harassed Nick for quite some time, probably the better part of two decades. And then again, thank you, David Clark. The research of David Clark finds the RAF officer Craig Lindsay. Just last year, Craig Lindsay happened to have kept that print for 33 years and out it came in a roundabout way. So now we have one of the six copies of the film footage, but we're looking for the witnesses to come forward again today, which is it was August 1990. And what do we know? August. Two years ago. Yeah. August 2023. Right. So, so I have something by chance, any of these people are watching or they've told maybe their sons by chance, they know this story. How can they contact you? How do you go about that? There's a very specific thing I'd like to read if I may because it's really important that I get this right. And this came in from, well, you know, I might have to keep them anonymous. So let me let me read this. OK, here's what we know. And this is we don't know this to be factual or anything I'm going to say here, but it's just we think Kevin Russell. It says care of Kevin Russell on the back of the photograph. I sent you one of the videos. You can play it on the back of the photograph. We don't think it was the original of the two witnesses. He was most likely a friend who acted as a middleman and took the images to the Scottish Daily Record. The two witnesses were illegally poaching and had taken pictures of their kill immediately before seeing the object. Source stated that the film reel showed their kill before the six images. Defense intelligence visited the two witnesses and colleagues stated that they were visibly shooken. One left the area to live with his mother on the west coast of Scotland. There were two Harrier jets caught in the six photographs. We're led to believe that one was RAF and the other was US Marines. Again, we don't know for sure. No trace of these jets has been successful, certainly in the public eye. I brought this up with Nick Pope at the Ministry of Defense. He's still restricting on what he can say, but this is just a couple of days ago. And Nick said to me, perhaps there's data missing in the official Ministry of Defense files that even himself was unable to get access to. In other words, they could have found those pilots. They could have given their testimony and that could have been all classified. We don't know source until it's found a very clever way to cover up the entire case of the M.O.D. covered up the entire case. Some people say that it could be some super secret or radar reflector. Craig, Lindsay, Nick Pope, don't believe that explanation, but we don't know for sure. So if anyone is out there, please, pretty please with sugar on top. Even if you want to do it somewhat anonymously, you can find me on Twitter at at James C. As in Charlie Fox at James C. Fox, my feed is open. I'm tempted to give my email address out as well, because if they don't want to go on to Twitter, but I'd have to say. They can message me on Instagram. They can. Well, James English, too. They can message me on Twitter, Facebook and I've got an email there where the team watches, where people can just click the email. OK, just thinking for other options for yourself, I would turn myself into a pretzel to be able to meet those witnesses. So please, if you're listening to this, please come forward. If anyone has any information on this case, please, pretty please with sugar on top, come forward.