 uh day two files and directories there will be but before we go into the files and directories et cetera so let's go for the let's go for the one decimal and you will see oh let me ask you what you actually remember from the day one so please click a link I mean if there will be just a second if there will be the newcomers so there was a link that you've got so from the from Enrico and so if there will be if there is someone who's not who hasn't heard anything from yesterday so here is a bunch of links over there and one of them is the pressamo and this is where I keep kind of interactive uh interacting with the audience and so what am when I'm saying that the pressamo link please click pressamo links or basically I'm saying that click this one and see what's there will appear so at the moments I am trying to ask you what do you remember from yesterday and please click it you can click multiple you can make multiple choices and you can change your choice on the fly just read carefully and see what you are up for people slowly but surely I'm waking up so to the newcomers they have appeared certain people at least when we have started so we have the pressamo if you go to the pressamo and try to make your choices so kind of remind you from the yesterday before we go for the next sessions for the next sections you remember probably from yesterday that we went through very general description what's the bash v so what's it up for then we went to the site that when we already touched already some of the comments that you can run from the comment lines and that amount of comments that we ran last time was pretty much enough to survive overall to feel good or at least don't feel yourself as I guess we even have created the first bash script as such and then we quite deeply went through the processes what is how to monitor them what kind of utility is available how to kill them how to work with the background and foreground processes and we even mentioned some utilities like screen and see mugs okay I'm still waiting for some of you there are at least 32 in the zoom so I expect that at least 28 of should be not us and again introducing ourselves so it's along with myself there will be Enrico, Richard, Mira and Thomas so there will be five of us also helping on the hedge dog so I also so do not hesitate to use the hedge dog so it's leave and now the day one had no ready kind of collapsed so now we are using the day two section and so if you have any question if you have any comment from yesterday etc so please don't hesitate to ask over here okay anyone else so there are 22 replies should we wait for 25 at least and then we will continue then it's a kind of sign to myself that you are already in and not sleeping at least let's wait for 15 seconds more meanwhile I will copy paste it to the chat or do I have chat yes we do it's actually in there already so just and here is the link once again so that everyone who has just arrived can see it so we already 25 24 still okay let's go anyway let's don't wait anymore so what do you remember regarding the process and bash from yesterday bash is an interface in between and using operating system so everybody has got this idea okay that's cool 24 replies that is true bash can be run native on linux macOS on windows it's not fully correct so it can be run on linux and macOS but windows doesn't have any kind of native bash it's still a kind of and vsl this windows subsystem for linux and git bash it's the implementation but it's not a native shell so to say windows has its own native shell it's called power shell I mean if you're up to do something some kind of shell scripting with windows it's also possible just try to google for the partial scripting a user main document page by issuing the amount in command exactly man stands for the manual and man and then the name of the comment and you will get the screen of text with the kind of summary of what this command can do and what options is there and even some of them have the ready to go examples PS AUXW list all the process running on the system that belongs to you it's almost correct but it fails in a sense that it will list all the processes not only yours I mean if you want to run on the years then they just put minus you and their username and then you get everything what is behind your behind your real ID a user can stop kill any process with the kill command it's not correct so for your view still think it's correct it's not the issue here is that can any process so it can user can kill only the processes which he or she owns but no one sells otherwise the the security of the system would be really compromised if everybody would be able to kill the everybody's processes okay let's go to the actual material so I'm here on this on the github it's our linux shell tutorial you have a link also on that notes and now I'm going to the files and directories so let's see what we have over here so I'm I was talking about yesterday about the processes and I named that these are two big instances that you're working usually with when you are logged into the to the computer with the terminal so it's the processes and then the files and directories files and directories is even bigger in a sense and we spent more time on this and most of the utilities they actually and the least of the utilities that allows that allow you to work with them files and directories is a little bit longer not a little bit way longer as compared to those lists that can to manage the processes file is essentially is something that contain data data or data they can have different formats it's the the idea is pretty much everywhere on all the operating system be it macOS windows or linux and so sometimes you will need a special program to open or to deal with that formats or that another format but along with the content which is kind of object data in the file you file also has lots of the meta information but meta information when we are saying this in the IT department so we're talking about the name of the file permissions time stamps who is the owner of the file etc so there are some others this is you must understand so that this meta information is always part of the file and then on top of that directory directory technically is also a file but from the user perspective this is something where kind of other files and sub-directories can be that can consist the other sub-directories and other files so it's a kind of folder or technically I repeat it's also a file and so in practical aspect that means that it also has lots of the meta information like again time stamps owners permissions and names etc and the first file and the first command the first command that you get to run when you're thinking of the files that's definitely ls which stands for the l for the listing ls as such gives you nothing else than just a list of the content of the directory but then if you look at the man page of the ls you will see that it will provide you quite the list of possible options how to expand the listing of your directory so and the first one to use is ls minus l so here you will be getting already quite a bunch of information with the meta files with not only the files itself but also the meta information so and let's go briefly for what you see with the ls minus l at the end comes the file itself then that's the last time has been modified here you go then size of the file itself then the group users that kind of own the file then the user itself which owns the file and then on top of that that comes the permissions there's another one column over here i'm not going deeply here's the number of kind of number of links we will patch it not today but in in spring so not important at the moment so another one thing that you may remember that you may want to know is that there are some special files special files which are starting with the dot so some files which start with the dots so let me go to my home directory and you can see that the list over here will be even longer overall but then there is something which is missing from this list and these files are called dot files or hidden files and to see the whole content of the directory including close hidden files you must put a capital or small one both will work and there is some difference but difference is only that capital a will give you everything without double dots i mean the parent directory and and current directory but then capital a will give you only the content of the current directory and so now you can see that actually you have very long at least and usually so you have a bunch of this dot something what this stands for dot something this is the more or less traditionally these are the files which are used for the initialization for the configuration and which are not supposed to be edited or deleted somehow or accidentally or not by the user so this is the programs or batch itself for instance it creates lots of different stuff like bash if you look at the ls bash dot bash something you will see at least bash history you will see bash profile you will see bash after c there could be others as well so these are the kind of configuration files which are by default hidden and the purpose of hiding them is just that you do not delete them or do not edit them or do not override them by mistake so but they are there nothing to worry about usually they are small so they can grow up as well and they even that usually you don't really notice them but sometimes you still want to check them and see that what's the size and whether anything that you can delete especially if you have a quarter but let's not go any deeply to that so one thing when you're talking about directory and file when you go a list minus l let me go to the demo space back so that the list couldn't be that long less minus l once again and so you can see it's native it's quite compact and you have only a name of the file but the way those files are organized is called a file system and file system it has kind of system of addressing and addressing usually stats with the slash so to say what about the path to some directory path to some file this is the names delimited or separated by the slashes so slash character in linux file systems is the only character which is which cannot be used in the file names this character is dedicated as a separator as delimited in file names and directory names and sub directory names and so and by default the root directory the very first one is going to be just slash so when you type something like ls minus l slash you will see the list of directories which come from very beginning from the root directory and typically speaking as a user you shouldn't care much about those the only directory where you will have full access write and read and search etc that will be your home directory there will be probably some kind of mounts where you have something like project archive or some remote directories mounted from some other services etc but then the rest of those guys like buddha etc etc so that will be not really for you so you will not touch it will be used by the system that's the installed software that's the some some some processes some lock files some binaries which are collected in there and so basically used by the by the system and system that's not new actually for the for the linux that's such on the windows and macos it's pretty much the same user only has access to the full access i mean to the home directory and then so some other directors but then the rest of the directories is just hidden somewhere and used by the system linux is no different from that why i'm saying all this so one of the common that we used already yesterday was pvd that's the one that shows you the current directory path and so i'm here for instance and this is my directory where i'm currently in so demonstrate that would be the subdirectory inside of my home and my home is looking like this it's a little bit complicated on the normal linux system i mean the standalone linux since that would be just home and that's it but since we are at alto and i am on my alto workstation so there are thousands and tens of thousands of users and so this is a little bit more complicated than done on the standalone system but anyway it's just leave with this and just remember that this is your home and you shouldn't really be worried whether whether whether this cryptic notation is coming from so the one thing to repeat once again slash is the delimiter so basically everything what comes in between slash that's the name of the subdirectories another subdirectory another subdirectory and the directory itself and then what comes last it could be a name of the subdirectory as well or could be a name of the name of the file and the next thing is that when you see the path that will start with the slash and that will be the full path or in other words we are calling it absolute path there are options option is that if this file is given like for instance like this name let's say name of the file what am i looking for at least the most space okay so let's say let's say i'm looking for some file name yes and when i am dressing it like this without any path this is called a relative path why so once again if i put the slash at the very beginning then my file system my linux it's not even bash it's linux which will expect that this file will be part of the will be just in the root directory and so when i get this ls slash file name of course i'm getting the so it knows such file of the subdirectory so if i want this to be correct and i want to say specifically the absolute path so the file name i should put the whole long path from the beginning of root and blah blah blah all the subdirectories and all the at the very end the file name in this case we will system we will find it correctly and you will see that okay so the file is there no error has come but this is usually not the way we do this so usually when you go to some directory when i for instance now in my demo space usually what you do is that you start searching the data or start listing the files from this current directory and so the path which is like this for instance will be just the relative path and the bash and the linux itself will assume that actually when you ls and some name and this is the relative path you are starting serving for this in your current directory so that's the thing to understand and to remember that's not it so there are other technical things we will use them a little bit later but within bash you can see several notations that can be used to simplify your life for instance one notation is double dots double dots stands for the parent directory so when i say something like cd double dots i don't know the name of the parent directory or even if i know the name of parent directory it's enough for me to know that the parent directory is always the double dots and so while i will go back to the directory which was the above demo space okay let me go back to the demo space another one thing is that dot stands for the current directory so cd dot doesn't make my sense because you are already here you are already in the current directory but then for instance if you want to address a file like you remember there was the uh hello shell file which was the our first command my first ever script so here when i'm trying to execute that hello dot shell i'm saying explicitly that my file is in my current directory and this is why i'm putting this dot slash hello shell at the very beginning so that's the relative path for the execution and you can see the system can find it if i do it without this relative path system will not find it so system doesn't know that it should look for the for the file in my current directory so that's things to remember that's a special notation another one to strain is the tilde tilde you can type it on the finish keyboard you have to type you have to press uh write alt and then tilde sign and then press some space or whatever so you will get it out tilde stands body fold for home so whenever you see something like cd tilde you will go to home uh truth is that if you run cd without any option you will be redirected to home but why till this gets useful sometimes you don't want uh say that i'm somewhere deeply let me say that i'm somewhere deeply in i don't know let me see that i'm in skip over from some previous years okay so i'm somewhere you see that my file my directory somewhere else so i want to go back to the demo space but i want to go directly from here and i don't know how deeply i am on the tree of my file system so i can use tilde so when i'm saying tilde here i'm saying to the bash that please start from the from my home directory and go to the something which is where i want to so still is always can be useful this way and quite often you can see that abbreviation that tilde just stands for the home directory it's used within the variables can be used within the scripts it can be used like this from the command line if you know that okay in your home directory there's some other directory where you go to or some files that you want to launch or in walk or whatever so that you will go to the tilde okay so this kind of stuff it's more or less from the web page i gave already this one and this one so let me let me show you that for instance ls yeah ls has different options and you may want to try to play with them and but i want to mention at least a few which can be useful ls minus l you already know ls minus capital a you already also know but then you can also use something like lst for instance or ls tr which says you that please all the output that comes should be sorted by time and in the course of models so whenever you see something which has been modified recently and that would be sorted on the timestamp okay that's the alt r that's one of the then if you want to sort them just based on the extension of the file that would be the minus x so this is the few if you want more just go for the man ls and see what else ls can show you okay then i want you to send back to the screen to the press email and let's see that's what you already got out of this so before we continue please just take a look at these questions and see what you what you actually remember but usually i'm trying to wake you up all the time i know that you're after lunch and so don't be really sleepy it's coming along pretty good so let's continue so you've got it pretty well i'm gonna say so slash is the only character that can be used in the file directory correct so all the other characters you can use but you will have to use the quotes etc or something like this but then there are some other special characters of course but again you can use them still and they can be readable all files will have owner permission name timestamp exactly so this is what we call the meta information file name must be in the lower case that when at least one of you think that that's the correct it's not correct file names can be any it can be in capital it can be whatever as special characters as spaces etc file directory name that starts with a dot is a hidden name ls will not list them that's correct so ls minus l will not list anything which has a dot as a first character in the file and so that means that you have to use ls minus la be capital or small hidden dot files can be seen only by root it's not correct so hidden file even if it's called a hidden file it's not really hidden from anywhere it's just the file which has dots in the at the in the beginning of the name so it's nothing to do with the root privileges as such who are as a user you can have the hidden files in your own directory as well only root has full access to all files on the local file systems that's fully correct so everyone who has the root privileges again probably i didn't mention it properly but root on linux that means equal to the administrator so basically when we are talking about root that means that this is the username for administrator and that's the most common notation on linux system and the last one regular user may not access anything outside of home folder it's not completely correct and what i was saying that your home you have full access by full access i means read write and search permissions so and you're kind of the owner of that directory that's the correct that the regular user is the owner of that home directory that belongs to him or her but then the others they can be access can be restricted only for instance only for reading like all the binaries in the bean as in the bean directories they are readable you can change them you can't modify them you can delete them but you can read them and you can execute them so you still have access and actually there are lots of kind of files that you still have access but you can't just modify them okay let's get back special characters special characters that's already to some degree mentioned but then on top of that let's see what we have here so i copy paste these guys to my to my command line and explain it just it's from the command line the wildcard that means that can be replaced with any character the question mark that means any character but only one a wildcard that stands for any amounts but this only one then the square brackets square brackets that's grouping so in case of square brackets you can put something like a b c and that would mean that this particular character can be a b or c so only one of them but not all three of them so it's a grouping of them in the same way you can put once feel free or like or it could be one dots or five b s f so that means that this character which is within this replaced by this group it could be one of those listed within the brackets and and that's also grouping but that's negation so basically if i put the exclamation mark then that means that the character that i'm expecting to be here is everything else but not c v or b it's this particular example then the this is as far as i remember that's called the brace expansion i can be wrong but it's it has some kind of name this curly brackets we will now go to the examples you will see how to use it but just to see so now it's how it's different from the grouping is that here you actually have the combination of characters so what i'm saying here is that my next part of the is a b c all three or x y z or then if i want something else or one two three or f six so that can be any five six and so basically i'm saying that that can be any combination of this listed over here uh delimited by the column and then the last construct is that when you want to list the um the numbers from one to ten but you don't need to put them the way one two three etc so what you can do you can just say that from one to ten and that will be understandable for the bash to expand it one two three four five six seven eight nine ten let's go for some examples so uh i for instance i want to create a directory that's the directory would be command make dear okay and let it be my first directory i'm called dear make dear dear essentially well let's make another one folder or even nicer so you can see that in my demo space i have now two directories dear and folder it's not so impressive but it will become impressive when i will try to do something else like for instance i will try to create a number of directories using the brace expansions so let me say that i want a folder but then i want a number of them and for instance one of them should be folder a another of them should be folder b and another of them should be folder c let's see what will happen you will get three different folders a b c d a b c which have been created just like this so that's the kind of magic of the syntax okay let me put another one like are in for instance x y z yes but i won't just x y z and i can type it this way and what we will get is that we should get i guess x y and z so you can see that notation also works if you just know the sequence of the the sequence of the letters in the same way you can do it for the files for the files so when you for instance touch touch a file it will create an empty file so you can see that this empty file has been created if the size is zero the name is there time some default permissions and my credentials okay but then in case i want to create a again a bunch of files and let's say it will be one two five yes and let's say that it will be some txt files so that i know in advance that it's gonna be the txt files so i'm touching them i'm looking at them and you can see that now i've got the five files with the txt extension okay so now i have a bunch of this stuff and that's enough for me you can actually do the combination as well so if you want to think that okay let me touch some more files txt and i can even say that okay it could be d and let it be c whatever just something that comes to my mind immediately and so what will happen over here that we are getting actually not five but ten files so what will happen with this notation bash will try to first here is come here comes the first character it's replacement for one single character but it could be one it could be two it could be three it could be four it could be five okay here comes another character but it can be d and c or c no sorry not and but or c and so that means that i will have two files which will be one c and one d there will be two files which will be five two and c and d two d and two c three c three d three c three four d etc so that's the kind of magic if you want to create lots of stuff in the same way it's a magic when you want to see something for instance what kind of examples i have had somewhere well let's see that we have in the root directory we have two directories which are called bin and sbin so we will go to the right be yourself for instance yeah so we have two directories over here sbin and bin itself so what's the way to do the to list them out with one shot so you can of course do it like this and Alice will understand it completely but you are lazy enough and you are smart enough and then you can say okay it's actually can be s or can be nothing and that would be enough to list both directories at once they're pretty long but just try it on your own so there is no error message so what has happened is that lssbin has done it the way so i'm here just exporting this and putting this so this notation has been expanded pretty much like bin and usr sbin like this so that's the last way you can use it then what else we had we had the something like this let's continue our playing with the sbin so for instance i want to list all the binaries in the usr bin directory that will start with the i don't know with the a and i can say here that it can be a for instance b or c let it be this way and then i put the wild card and say that everything else it doesn't matter so i'm only taking care about the first character and voila you will see that i will get actually the so the list is pretty long let's have some better proof let it be x y hopefully no x y is probably yet another one whether it be w and y so you can see that actually i am only listing over here the comments that will start with a w and y and nothing else in the same way you can use it actually for instance if i think there should be anything but not stats with a or that will be a list again so now you can see that actually i will get everything else except the ones which would start with the small a b c d blah blah blah t y so and here i get all the information actually interesting let's try to see that is there anything which is not which doesn't start with the with the with the letter so you can see that actually there is a bunch of stuff in the usr bin and there has been directory which doesn't start with the letter so there is some kind of interesting so i need to check it out what that stands for then some with the with the number some with the capitals and so there are capitals and then some okay they also start with the capital so not to get you confused but to get the kind of impressed once again about the powerful of all these notations that i can use we will play that with them during the during the exercise session but just to see okay that there are lots of kind of things that you can do and make you make your syntax of when while you're working with the command line way more compact one more thing that i have to mention over here is quotation quotation is actually important because for instance if i create a file in my demo space which will have a space like yeah my file for instance dot txt what will happen over here is that you will see it will be created two files there will be created file txt and then there will be mine so it's not exactly what i want if i want to create something which is which name will be my file i have to use the quotes that's one option then another option is to use the double quotes i will explain the difference just in a second that's also work my let it be my second file okay and then another option is that you make the quotation for the special characters and the space is the one of them you can use it explicitly with the backslash okay and so now i will have all three files over here my file my second file my third file they all have been created using these notations what's the difference between the double quotes and single quotes single quotes they take everything as is and they just whatever special character will be inside it will not be interpreted as a special character that will be used as a normal character but the double quotes they will try to open everything what is inside and for instance if you happen to have a variable like example my and i put here user what will happen is that this variable user my username will be replaced with my username let's see what will happen okay so my then my username then something which is at the end comes and try it with a different way with the single quotes with the single quotes you get exactly what you try to get so but not but the user my user variable my username variable has not been expanded so that's bad but that's just to remember that these kind of things may happen and now just keep it in touch keep it in mind so now i was about to see to mention you the number of comments which i about which i around and then these are comments like um cd you know it already so when you cd you change the directory you choose the directory and you cd over there then if you go back you go back make the you already know that as well so you make the you create the directory hold the 36 okay then copy these are the something which haven't been touched yet so only touch itself has been touched but then copy then if you want to copy a file file for instance and i want to make a file dot let it be new so the copy will happens that you will get exactly the same copy of the file so basically you will have two two objects on the file system file and file new difference between if you don't want to have two copies of the same you may use move move is a kind of rename so we don't have a rename comment over here we have move command and you can use move file from one directory to another you can use it move one directory to another one sub directory to another or you can move with also to rename so if you move your file directory within this same sub directory it will be just simply renamed so if i want to for instance file rename it to the file new too i can do it this way and so you can see that lsl file and i see me okay listening only the files here you can see that actually file has still appeared but now i have file new which has been moved the result of moving and then file dot new which was the result of copying i have bunch of stuff over here so let me introduce you the command called rm so remove be careful with that because you can actually remove all your home directory so don't start playing it right away and every time when you try to remove something please think twice before press enter so but let me show you also how to use this some kind of stuff like for instance i say that remove everything which starts with the one but then comes a character after that and guess what you will see that we have lost everything like one c one d so they have disappeared from the list okay so let's say i want to do something more sophisticated and just playing of course there's no kind of sophisticated sophistication over here but let's say that it could be one it could be two it could be three but it can also be something else but for instance can be some any other character or no character at all so the problem with the with this mark with the question mark is that it does it's a kind of replacement for the character so it does expect some character but the wild card it's expect any character or none so that's the difference between them and so let's see while we're back so again we have removed everything which have which have one two three and then anything else so again those guys have gone but then we have left the rest and actually we if we decide that we don't need actually anything of this one so we can just simply do it like this so we're killing the rest and now you can see that everything which would start the file and txt at the at the end has been removed and we don't even need the other stuff as well so we can actually do it like this we can always recreate it anytime later what's happening with the folder folder is a little bit more specific and actually let me before we go to the folder let me remove those guys as well so this is you start it and you can see that m is trying to well it's trying to give a to play the game so let's see what it will do about the about the spaces so there is a rem my okay my is okay there is my user something my file my thought my second file so if you want to specifically say that okay there is a space after that you say you put the backslash and then only you continue and say okay remove everything what will have what will be looking like this okay we have removed only one single file you'll see it has disappeared and then if we say that actually we do not need anything which starts with the my we will delete it like this and also have my several tests okay folders folder s is a little bit special case if you say copy for instance dear so dear dot new trying to rename it you will get the error message simply because copy by itself only can copy a file but then if you want to copy directory then we have to explicitly say that please do it recursively so you do it with the minus r dear dear new and so let's see what has happened dear new didn't exist previously now it's exist so now we have two directories dear and dear new rm doesn't do it either without anything else you will get the error message but then in this case you can also put the minus r folder and then you delete it and then if you want to delete all of them you'll proceed it in the way like this what am i done wrong i have renamed i have deleted some files okay i have somehow managed to kill the jobs my background jobs which have been updated to yourself over there i don't know why but demo space there were nothing okay somehow the okay don't worry it's a demo effect okay here we go we are still going the way so we can also remove the folder stuff like this so we don't need any of these actually you can remove many of them at the same time but again be careful so every time when you press something like this so you better be careful somehow it doesn't like when i'm killing the okay i will not do it anymore anyway so we are now close to the close to the press more next one so let's see what you've got out of this so go please to the press more and click the next one and then we will have a break for 10 minutes so let's see what we have learned there will be break for 10 minutes and then we will be talking about the permissions and then after all we will be going to the exercise yeah it's coming very well already 97 replies five seconds more to react some of them are simple but some of them still requires some kind of logic and at least careful looking okay let's go through the for this press more the first one was a rem and the wild card it's the statement was that it will remove all the subjectories in the current fault and that's correct that's not correct sorry so the as i just told you are by default will work with the files and if you don't put minus r if you don't put minus r then that means that you will actually you will see there are message try it i mean you if you have some deeper already you can try it out and see that what what will happen it will remove all the files in your directory but not the sub directors ls minus capital al will list only hidden files it's not correct if you would put the minus a minus l you will see all the contact on the directory including the hidden files actually there is no easy way to to list only hidden files you should script it a little bit there is no option for this with the ls so you either list normal files or normal files plus hidden ones hidden ones but not the hidden only so the tilde is for the current directory it's not correct tilde is a home directory so it's abbreviation common abbreviation common notation for the home directory the directory which you are usually in cd double dots will go to the parent directory correct so that's the notation for the current directory and then one comment that i have used already previously but didn't mention it today but yesterday and but you should be able now to already tell what it does this qz h minus hs so it will give you the kind of file and directory sizes one by one and then you are saying exactly what you want when you put the wildcard you are saying that give me the sizes of everything which is not hidden but then you need to explicitly say that please give me everything what is hidden and what's happening over here what's this cryptic notation stands for if you put just dots and just wildcard you will also get the this one the parent directory and that will be nasty this qz h will try to catch everything from the parent directory but then here what we are saying that okay my second character is anything else but not adults and this way where i get in the correct answer so we are looking at the space usage by the files and directories all including all the hidden ones so that's the statement is correct so please you you can even write down this command somewhere for yourself and so definitely you will find it useful later copying the pdf files that's correct simply because that will be replaced with the abc and then with xyz and that will be every single number from zero to nine and that's correct so and then the pdf will be the extension file and then the name of the file can be any after any which will start with the digit and it will be copied to a new directory so they perfectly fine working commands and description of what it's doing while our directory name must be quoted special character characters are used correct so since we were just talking about quotation yes you ever if you ever do something with the special characters please make sure that your quotes are there okay now it's time for the 10 minutes break please special x and we will be back to in 10 minutes so 13 10 10 after one or whatever time you have in your place where you are i'm muting myself but i also will be reading the notes so still free special x grab a cup of tea and then also keep staying all the material okay let's get back so there was one request to make it to this floor i'll try not to invest yeah but quickly speaking i'm trying to put as much information on your shoulders so that you it's up to you what you actually pick it up from the course totally okay but i will try to make it to the floor so i told already a lot about how to use the cd my dear copy move and rm etc but that's the way ls also but that's the way to kind of common way to work with the files in territories one if you one if you a few more comments let me say that tape a i already told you about this but so if you know from the perspective that you know what the path is and how it looks like so now you can of course for instance get already information okay where this guy is so it's part of the usr being and somewhere in the less so that's getting the information about what's behind the comment that you are trying to execute that's good one so another one like file if you want to know what kind of file it is or let me say that we have anything like hello shell it will tell you exactly what type of the information not the not the information itself but what type of the information or what type of the mine mine so to say so of the file that is and then in the same way that if you want to know something about the binaries so you can also ask about the binaries you will get some kind of information so that's the additional meta information about the file but then there is one thing which is called stat what's interesting is that you don't usually use it but you may want to know that it exists that will give you the kind of statistics about the file and along the in a sense that it's advanced statistical experience as as compared to the to the ls so you will get all the meta information about the file including the access file modifier when it has been changed so very recently and then additional the blocks the i o blocks and the number of links that the exactly i not number etc so if you will be ever using this working with the file specifically on the linux file system you will find that as well useful so now i think i am done with the information how to get the information and how to get the file how to work with the files in the directories except one thing that's the okay i skipped also the link probably you will know that you will not need it right now but we will come back to this if you if you will find it useful and then permissions that's one of the things that everyone will probably at some point will will touch in the while doing with the files and directories so you remember when we say something ls minus l the very first column that will give you the permission information on the linux file system sorry on the linux file system permission are exactly the same independently which one is which one concrete the file system is in in use be it axd xfs be it lustra or whatever whatever else so the permission system will consist of three different octets so the first one will be the user one the next three will be the group one and then the last three it's the others so let me say it once again i copy paste it over here to my screen i commented so the ideal not the ideal situation but the full permissions they will look like this so what they stand for first let's divide them like this so the first part will be the owner or owner permissions so owner will have either read write or executable then the group which owns the file or well let's say owns the file it also may have read write or execute permissions and then the others so not the owner not the group but the others it will be also read write or execute and all together it will give you the full range of the permissions so it's a little bit simplistic but it works very well in most part of the situations so we are not going now into the acl actually if i will have time at the end of the section i will go to the acl advanced list control list but otherwise the thing to remember so file may have may have in the classical notations of the linux file systems have may have only one single owner only one group and then it can be also provided or not provided access to the others so what else you must remember so now i have in my in my so let it be like this now i have also in mind to say like this so always when you use a command to change the permissions for the user for the group for the others you don't put the explicitly user or group or something you use the notation u stands for the user g stands for the group o for the others and then all together that could be a kind of abbreviation for all so basically you will use in most cases in 99% of the cases only those ones and let's see that i have i don't know let it be hello shell i will use it as a test so in order to change something like permission i have to use the the command change mode now i need to explicitly say what exactly i want to so i now see that this guy has been giving permissions to myself read write and execute then to the group read write and execute and then to the rest of the people just read and execute what i want to say here that i don't want it to be executed by anybody else i'm saying i'm using this notation from here oh that means others and if i want to take a rework some permissions i'm saying minus and saying that okay minus x what will happen over here is that you will see that actual permissions from the others have gone you will see it exactly over here actually so if you know quickly hello it will be forbidden because you don't have the access anymore so let's try to get to get it back so now i want to get it back and instead of minus i will use plus okay and let's say that i can also may also wants that actually group shouldn't have the write permissions group sorry and that would be this way and now you can see that's of two changes over here my group doesn't have write permissions everyone else can read and write and i can still read write and execute if you actually go back here you can see that okay now you have access at least i've got access over here with no problem so what else to remember you can group this changing of these octets so in the same way you can say user meaning of minus write permissions group minus write permissions and then for instance others minus all permissions it can be also done this way easily and you can see what will happen so it's exactly what i asked so i removed the right permission from myself and they would remove the right permissions from the from the group and then i repair to convey all the permissions from the others and so in the same way i can return it back but another one thing that you may meet at some point is that these kind of notations are usually and quite often are written in the numeric form and so read stands for 4 write is 2 and x is 1 and so how it looks like in case of the change mode so let me get back to the situation like here so i'm setting up permissions for the hello i want us to be writable readable and executable by myself so that will be seven and then i wanted to be seven of how i got it writable for readable to executable one two plus four plus one seven so i wanted to be writable and executable by a group that's five and i wanted to be readable and executable by others that's five and voila if i put it like this and you can get back to the hello you will see exactly what has happened what i wanted i would say that most of the people will use annotation like this one it just for the sake of it's understanding understandable better but then quite often you can also in the scripts especially see something like this and so basically i am opening this for you just do not just it wouldn't be cryptic next time when you see it within the script or next time you will see it on the google on some main page okay so that's change modes for specific files what i forgot to say over here i have forgotten to say that if you let me create some directory once again make deal and what i forgot to say that the actual folder may also has i may also have this x bit over here but it doesn't mean that folder is executable in case of folder x means it's searchable so you can basically it's not even searchable it's listable and searchable so let me say that if i for instance let me go to the folder and so that i create some files over here and let me say it will be five files over here you see okay i go back i list folder and everything is fine but then if i change mode and if i delete from myself if i do it like this from myself if i delete x let's see what will happen or let me say that i can delete from group and from others as well i delete the search option what will happen over here i will not see what's in there and so that's the difference between x for the file which means executable and that's the difference between the x for the directory that means searchable so i get put it back and now you see that i can see it once again what's what is then what's listed this one another one like for instance i want to make the changes to the files in some sub directory i can do it also and i know what my directory is called like this okay change mode but say i want to make the changes to all the files in the sub directory in this situation i need to use the capital r which stands for the recursive so we do the changes to all the content of the directory recursively so for instance i want to remove from the group the right permissions and i can say here okay it should be the folder and another one useful option minus v which stands to be verbose so that we don't need to put ls out so we can see already what's happening right away so you can see that actually what we've done so we took every single file which is part of that folder and we grabbed that right permission from the group okay you know you can ask me a question why group is so important in the many cases group is not important because you are probably something which you have something in your home directory and you don't care much about the group ownership but then if it's a shared one and imagine you are in the situation when you are working in the project directory or your archive directory or some working directory where there are other group members there are other members of your group i mean physical group something which is at your university and then you may want to have access to the same directory to the same file or number of files and but the owner can be still only one again i'm talking about the classical file system in linux i'm not talking yet about the access control list but in this case it could be only one and how to share this kind of thing is to make a group owners give them the right to write to read and to execute the files and directories and so this is the situation when the group actually becomes important how to change the group so there is this comment change group the only tricky thing is that you cannot change the group first the group that you are using to change it must exist because default mine is domain users that's for everyone at altitude university it's domain users but then if you want to assign it to a new group it must first exist the second one it you must remember of that group that you are trying to assign to so how to find out which the group member i am there is this very nice comment called id minus gm capital gm it's pretty much the same way it should work also on your so let's say that i'm not going very far away so i pick up one of the group that i'm using and i do some changes to the folder and i do the change group and i put that my group name will be the one that i picked up recently and let's see what happens and has happened the thing that actually every single no no not every single yet just a second so ls ld to see my directory only so you can see that actually my new group owner here became wasp so this group does exist second i am a member of that group and from now on in principle there are some details yet but in principle everyone who is a list on on list of that group you can check it with a get then group comment i will not show it once again over here just to don't compromise the other users over here but just trust me if you try to see the list of the the the list of those users just try this comment out on your own so just replace the vast with some group where you member of and you will see the list of the users which are on that group but anyway so all all the users which are on that group now may have access read and x access to that vast and if i want to make sure that it's actually not only the not only the folder itself but also the all the content of the folder i also set this minus r over here and now you can see that change group owner from domain users to wasp okay so that was kind of damn example i don't really care i don't really want fast people to be able to access my demo space so i can change it back i can change it back what was it domain users i remember that so i can change it back and so basically we are back to the back to the initial state but now you can see that how you can play with the permissions how you can play with changing group there is another one comment it's called change owner but in a sense that if you don't have the root privileges you don't use this comment never you will use this comment never so nothing to worry about not at this stage okay so where we are we are now very close to the exercise 1.2 and let's see that how much time how much time we want to dedicate to this actually i have one press email yet to go before we go for the exercise 1.2 and okay i also probably want to say something about umask and sbit and tbit but let's go for the press email first and please open it and open it and permissions and let's see what's what we have again multiple answers are possible as usually and see what you've got what you remember out of this case you remember yeah so as usual so when you click it that means that you think it's correct and when if you think it's not correct your chance just leave it unclicked let's say we are waiting for the magical number 25 25 replies and then we will go further okay so let's go for them oh you still keep seeking okay so let's go for them i might have only one or correct completely correct again i'm talking about classical system not about the acl i must say it's explicitly all the time because the acl it's becoming the acl this axis control this is becoming more and more popular and but still the standard de facto is this three octets for the owner group owner and the others but anyway an x-bit in case of the file system means executable but in the director case means searchable that's completely correct that's true change mode minus capital r or minus r w x d1 will recur so we remove read write exec writes from the deal owner uh it's not correct all stands for others an owner that would be you and in other words user so those are you have things that's correct you would be you would remove the read write and exec executable writes from the others but from the owner but anyway it's a kind of thing to remember because actually i myself sometimes just forgetting that which one is owner which one is which is others and then change own group name file does the same as change group group name file my bad i didn't say you anything about change group and change own and how they correlate but it's correct over here change own with the two doubles with the column and group name file will do the same like change group yeah that's correct that's correct but that might that so i'm not counting this if somebody didn't know that a user can change the group owner to any group that's not correct so i said explicitly a couple of times two conditions to change the group owner first the group that you are trying to assign to should exist second you must be a member of that group so these are two conditions which which can be satisfied which should be satisfied before you should be able to do you can actually try to assign to a non-existing group or to the group which you are not a member of you will get the error message change mode 600 file PDF will make file PDF readable variable for everyone and not at all so to make it readable and writable for everyone the last digit must be seven seven that would stand for the readable writable and executable uh must be six not sorry not not seven six readable and writable by everyone but here we have at the end zero that means that others will hold not have access either and so the group members will not have access either because it's also zero it's only the owner which will have readable and writable permissions to that file PDF file PDF okay and here is the core this three octets that you would see it in ls minus l and the sense that the means writable readable executable for owner that's correct and then readable executable for the group that's correct that's for the group and no access for the others that's correct so they were the for the last one was completely correct okay now what we have in mind actually i was about to mention you slightly about sbit and tbit you will meet this you will meet this because we will go through the find comment and we will use it over there so i must say a few words so along with the readable writable and executable uh you may also have set gate or set you it gate so to say so the thing is that one for instance my let me do this trick once again to explain so my command is my group is my default group is the main users and every time when i create a file file test you see that this file will be owned by that group okay so but let me create a folder folder one let it be folder one and let me say that this folder one will be owned by wasp okay you see that this has been once again improved folder one is the one which is owned by wasp what will happen here if i don't put the sbit if it's normal folder then i touch for instance file and the file will be just normal file with my default group as the owner but what will happen if i put unfold the sbit so what will happen over here if i do the change mode group plus s okay let's see what happens so you see that sbit was over here and uh folder is kind of set get it so to say so it's kind of so the executable bit is set for the folder and then if i next time trying to touch another file over here what will happen that this file will be already owned by the group wasp this sbit in the other words it gives kind of it provides the permissions that or it forces the permission of on every new created file to be exactly the one which is owned which which group is owns this folder so the feature is usable and interesting and especially usable on the folders like projects etc where you want to make sure that everything what is created under that file under that subdirectory directory actually belongs to the group so that solves your lots of headaches especially if you are developing something or if you're copying this stuff from somewhere and you want to make sure that everyone who is putting something to the directory every single file every single subdirectory will be owned by the group and group members will have access to otherwise otherwise it may be situation like for instance you have a directory which is owned by the right group and the group members have right permissions in there but somebody has copied there something which is owned by his own personal group and no one else will have access to that file or directory even if the parent directory itself is has the right permissions so that's why SBIT is tricky and and good one another one SBIT can be set on the file so let me see that's whether we have anything and in the SBIT for instance I guess the pink should be I don't know if the executable you know I need some comment to which would have SBIT on top of that so we can use find of course but I just needed for the sake of explanation oh actually that should be the possibly yeah yeah exactly so there is this comment for instance possibly the trick and you can see you can see that it has the execution bit execution bit and the SBIT set for the user what that means that means that every time when somebody execute that binary the effective user permissions will be actually the owner of that file understand that probably sounds a bit cryptic but the tricky thing is that you this way you kind of pass through the security issues so that you do not allow everybody access to the for instance some files like pass video or some other files but but every time when somebody runs this kind of commands it will get the officially the permissions of the owner of the command itself which is good and which is if it's written carefully it doesn't bring any security issue but it only solves some security issues anyway so that you know what the SBIT is probably you will not meet it immediately you will meet this SBIT for the groups that you find it useful SBIT for the binaries that's something which is more to the more specific for the administration but anyway it's good for you to know just in theory that exists one more bit that is mentioned over here is TBIT it's called sticky one sticky one that only means that it will give you for instance if you take a look at the tmp directory in your on your computer as well it will have a sticky bit so sticky bit stands for the everyone has here permissions to write to that directory but only the owner can delete and modify the files which are owned in that directory so if we say again that for instance here it's myself only or not only myself there is an actual other users so what's happened over here I can for instance go to the tmp and delete this one and this one I know only this one and then this one but I can't touch this one as well and this one because it doesn't belong to me neither any of them so that's what's what what's the sticky bit is for so it allows it prevents from removing file by another user okay and then the last thing about permissions then you that you'd better know is that the using the UMask UMask is something which allows you to set the default because you know when I create the file once again when I create the file you see that there are some kind of permissions are set and these kind of default permissions are actually set by UMask so there is a default one for the whole system on the system level but you can always change it and put it into your own profile how to do it we will know only tomorrow when we go through this bash RFC initialization files but just keep it in mind that it's also changeable okay so now I think we are good enough for the exercise 1.2 and let's say that we dedicate 20 minutes to the exercise and then I will dedicate 10 minutes to go through the exercise and see that how good we are at this so once again feel free to use the notes and feel free to ask the questions over there and now the floor is yours and just show and to those of you who hasn't been doing the exercises recent what tomorrow yesterday so what I said that everything what is marked with the this with the star that means it's kind of advanced I don't expect you to do that but only when you have done these ones and then you can already try doing the rest and if you have free time and if you are good enough at these things if you feel like it's easy for you so please go ahead otherwise I expect that you at least will be done with those 1.2.3.4.5.5 for those first ones they are simply they are quite simplistic so but anyway and press them all once again I put this exercise progress exercise progress somewhere how did oh let me just create okay so it will be like this let me create first okay it will be like this so anyway now you are on your own please go and do the exercises and whenever you are done on whenever we are close to the finishing of the exercise so we will continue at well we will be back in 10 minutes let's see what we can do so that we can go for the exercise right away and then check it out what you have done correct and whatnot so the first touch was the making the guarantee directory in the current directory so I am in my demo space I won't be able to make another one directory let's call it the directory like this and then cd there cd there and touch a file okay so now we are in the directory and we have it just one single file rename it rename it is move file file let it be renamed or whatever it can be just up to your fantasy make a copy and then remove the original make a copy okay and then I copy my file rename to the file copy and then I remove the original file renamed like this so I still have one single file which is zero inside what touch does touch by default you can take a look of course at the manual page by touch by default if you know a file it exists and just touch it will does nothing except it changes the access time I mean touching means they're changing the access time of the but then a file does not exist like for instance something it will create a file an empty one now we have two files also okay I tell you the first is done then the second one list all files in usr bin and sbin that start with non-letter character with one ls command so listing means ls minus something but then we are saying that non-letter character so usr bin and sbin how to tell it to be on the same screen so basically I'm saying could be s or could be something which is empty basically there is nothing so there is nothing yeah so that's the first thing the second part of the task is that something with a non-letter character so later in my case I can use a group a to set that and I can even do it more expanded a to set the once again and I can even put here the exclamation mark which means the negation so everything which is not like this so but again by the end of the I have to say that everything else is fine and here you see that I'm getting actually a list of cannot access something which is can be avoided but anyway here is the list of something which is to me sounds I'm just wondering what's this one owned by root although by mistake I have created something but I will check it out later why I am always suspicious with something like this when you see something which is not a normal name it's usually the hackers and the crackers which they are trying to put something into your file system they create a lot of they have really good fantasy guys so they create something with the dots with the two dots with the same names like normal binaries etc and so if you see something suspicious it makes sense to check it out at least what's there okay the second the third one least with ls not dot files victorious only but if all that least all files it was but not those that begin with dot files oh that's already a good one okay so let me go somewhere where I have the dot files let it be my home so what am I doing right here ls dot files victorious only so first of all I need to list all of them I know that ls can not really list only dot files it can list all of them or only normal files but now I need to get out of this something which is the now I need to put this let me say that I need to put dot files but only those without the parent directory so let's see it would be okay and then I don't actually want the directories I can put the d as well so that would be the that would be the trigger so the lda what it says so minus l a long list minus capital a a long list with the dotted files with the hidden files and then here with the d I am saying that don't go into the directory but open only but show me only the directory names and then I am saying that actually alone all the lists that you are trying to show me catch for me everything what starts with the dots but then after that comes whatever but my second character cannot be a dot why it happens like this that if I will try to do like this then it's automatically will be giving me also this one and I don't want this one because two dots in Linux notation would mean the parent character parent directory and it will start open for me everything well in my case it's smart enough it doesn't go really up doesn't go really up but in some browsers in some situations it will go up and so to be on the safe side we usually put this one so that was the that was the correct answer to be I mean this is kind of bulletproof solution so don't respect to that one start file explore a start file output we actually did it already so but let's try it once again so I go back to my demo space and go back to my start hello hello shell and once again exploration actually gives you very much the the information about the meta information actually here you can also see what's the difference for the touch touch file will should change this access time let's see what will happen just touch hello and start again and you can see that this was over here 037 now it's 1415 it's a good trick it's a good trick in a sense that you know sometimes for instance the some some big guys at CSE or at some other also institutions they decide okay let's let's put it this way so everything what is older than a half a year will be removed from that in that directory and from the user perspective everything what you have to do is just to go with the touch for all the files that you want to keep and so nobody will know actually that you didn't touch them explicitly but just use this trick so that's just some something for you to take to take out of the session so the rest was except this one somehow it's not start else tells for the directory has permission okay ls minus ld tells you that directory has permission like this do group members have access there not actually so the tricky thing is that which I haven't touched yet and haven't explained so that's the s bit over here so that's the set good but the difference in notation so if the s is capital that means that x is missing so that means that this directory is not searchable so if directory would be searchable and with s bit set s would be small that's a little bit tricky but you will find it out when you test it out so in this situation the answer is negative group members have read access but not search access there the director is not sure searchable and not listable so they will not have full access in sense so a little bit tricky but this is comes with the experience this is what comes with the experience so I click the next and I want to go with you for the fine utility it's very unixing so I mean it's I can name just a few uh there are there actually not a few there are quite maybe about 10 or those in this kind of utilities which are very long time history which have a very long time history from the unix times and which have been migrated to the to the linux and which keep going along with the linux and which are kind of irreplaceable so they're very unixing in this sense and fine is one of them then grep is one of them ps is one of them and tar is one of them and then maybe you can make a list longer but this is kind of things which can be found on any operating system which has the roots from the from unix and linux is just one of them it can find you everything on the file system it can can be run with no options then it will just list you everything what is found like for instance if I do find I will see every single file and directory which is in there but find itself is very complex and this is kind of a language bullion language which can be which can put lots of filters for the sake of searching the directories and files and lots of execution commands which can actually do something with the execution on the on top of what has been found in the results as I told you already so you can do it with no options but you can also do it with the option so the first option to do is that for instance if you want to see something from the very particular directory so I try to find everything in etc oh let me go back to already one that we have already used user being so all the commands that are accessible by you on the system most of them not all of them but most of them us are being okay that's fine that's the list of the files that they can find but let's try to now apply something and make a filter so I'm looking for something which is has name now let it be I don't know let it be something which will start with the p and then will continue with anything so the quotation here is quite important so use this notation just as I am writing so now you can see that we have found everything what is p so far it's not doing anything else than LS can do but then we can go more deeply deeper and already say something like let it be type F so we need to specifically say that it's a file okay then we specifically say that this file and it should be no more or the no more than one megabyte okay and then actually we also say that okay let it be not only no more than one megabyte but it also no older than I don't know let it be 30 days something and type no time sorry and the list of these filters is really long I mean on top of that you can of course say that it belongs to the user like for instance I must say it belongs to the root then I can say that it has permission which will as be said for the user which is not over here correct but you can change it to something else so the list of these potential filters and sorting parameters is very long as usually you can go to the front line manual and see what's there and the manual is so long and it even has the list of the examples that you may find useful by the end of the day that I just encourage you to go to this manual and read it and see what useful you can find out of there the message to take away from this one is find is a standard de facto for searching the files on the file system so if you use bash you must know how to use find so there will be lots of example over here so for instance some of them I already told you but then some good examples so if you put dot dot remember dot is nothing else dot is nothing else than your current directory you can skip it of course but usually you put it just to say it explicitly so now let's say that I'm looking for something in the current directory and then let's skip size etc and only type file or type directory so I can't list only directories only the files and then let's apply something so one option to use with find is the exec exec allows to do something with the results of the search so for instance I have found all the directories and I want to change mode for those directories and what I'm doing here I'm here usually using the specific syntax switches by find change mode and for instance I want to make sure that all the other users they actually have read and execute and the search options for the for the directory so the change mode and now comes cryptic so these double curly brackets they replace the outputs of the search and then this cryptic theme just finishes up these change mode exec constructions just remember this I mean this is kind of specific boolean programming language of find and you learn it and you will find it useful and then as well I can put probably minus V and which is making the change mode output variables so I'm getting more information more detailed information about what's going on what's being done by the change mode and so you can see first of all find has found all the directories in my current directory and then has changed it to something suitable in my situation all of them have been already in the okay state so you can see that it has been retained but then I don't know if I want to do something most stupid like for instance give also the right privileges then already will be the change has been will be done properly so but I don't want this so I want to remove make a minus but at least to for the sake of demonstration that this also works and this also possible so find the best way to find out how it works another one good example which I won't suggest copy paste from this one is find all s-beated executable binaries and again we are using our s-beam and bean and s-beam so actually one more notation how to put this in the correct way could be this one you remember previously I've done it this way but you can do it as much as as well as as written on the on the on the comment on the materials page so what I'm doing here I'm going for the user bean and s-beam it's written over here then I say that everything what I'm looking for should be file and that file that you find for me it must have permissions user must be executable must have execution execution execution permission and then the s-beat on top of that let's see what's there and voila we actually found quite a few of them and again from the security perspective that makes sense to check those files time to time it's actually all the utilities that are taking care about security they're changing they're checking the security that set-beat is not really set on any files which is not part of the normal system and not kind of installed by any of the cracker okay now you know another one useful over here we'll take a look at the material for instance if you want to remove all files older than seven days I don't know how to play with that one just to not delete anything accidentally but at least you know that it's there okay so the I want to go for the once again you have something in your mind one thing to remember so another one thing that I don't mention is that the exclamation mark exclamation mark in all the situations that stands for the negation so that means that everything except so basically what I'm doing here with these comments so I'm saying that find me everything in my home directory which does not belong to me it could be possible so let's try it you can try it as well in your own so I have nothing that wouldn't belong to me but let's try to do it also on this SBN and being deterrence everything which does not belong to root so there is no one file which that which wouldn't belong to root which is good so that's that's the correct behavior in both in both cases there is nothing that wouldn't be here that wouldn't be in my in my home and there is nothing that wouldn't belong to root in the usr bin and SBN well let me go with you once again for the personal and see that are you up for the fine where is my fine here here you go so try to react we will have something I think is 30 seconds yeah there is a good question about touch and there is good thing about the reply we defined so that's exactly what you want to do touch and just keep answering I will keep talking here in the background so if you touch one file it will be it will be just single file touch doesn't have this option minus r so what to do to do is the medicine for that would be fine so you can say that please find everything in my directory you can even skip the f so you can just see the directories as well both of them and say that exec and touch every single thing I don't know when maybe type yes maybe type f is needed since that touch probably will not work with the directory and so that would work for you essentially so you can make an alas you can make a kind of script or or just a function out of this one and use it okay let's try to go through the decimal the first was find always requires the directory name to search from and fails with no arguments it's not correct so one one trick over here you can you have the keyboard and you have the terminal open just try it out essentially with no comments with no options it will just give you the information from the common from the current from the current directory find name gpec with the wild mark we will find in the current directory all files that have gpec extension that's correct and then we have negation and actually that's one of the example that we are already touched during the demo so find then negation then username finds all files in the directory that do not belong to you yeah correct and but not fully correct it will find also the directories and the sub directories not all the files but i would say that it's true find work type blah blah blah finds all the directories in the work that have sb set for the group i've just tried it and i just don't remember exactly the syntax so let's see that i have the lsla so i you can see that i have only one folder which has the special sb set so in my case this minus will still provide me everything so that's probably means that in syntax of this find you should have class which say explicitly that it's has and one of others as well as bit so if i have minus over here here i would need to say explicitly that what kind of permissions it is have it has and not only so i mean this is a little bit cryptic but when you find it out how to do that once and when you copy paste this commands to to your brush apps here to use some to your own notes so you don't remember it anymore but otherwise you just go to the find manual page and see that and then how to use it and you will see the description exactly what's the plus minus equal or slash means so they can be some of them a combination of them one such is case intensive no that's not correct by default it is case intensive so you must say it explicitly if you wanted to be case intensive so you must say explicitly that i don't remember was it minus i or something so so that it's the and then find does not follow steam links it doesn't that's correct that's correct one option also to tell you so ls lfs find for instance since this original course has been prepared for the for the for the triton users on the triton we're using mostly work director and work vector is something different it's not normal ext or ext ext free ext for xfs file system as you can see it on your own on your own laptop or desktop so on the triton we're using the high performance computing file system called lustre so that's the optimized for the parallel computing and over there you have a special utility find itself which comes for the ext and the others this is not very efficient but we have the lfs find so why i'm saying this and this is specifically saying for the triton users specifically saying for the users or for cc resources or or for instance are the university resources in finland so that you get actually more efficient from the user perspective and also from the system administrator's perspective so you'd better use the specific implementation of find like for instance lfs find so that stands for the lustre file system why i'm referencing to this so that you know that defined activity is actually so popular that it has been implemented even for different operators or even for different optimized for different file systems so whenever you are on the big hpc cluster or you're dealing with some really cute storage system so that makes sense to find out what kind of search activity you have over there which one is the most most efficient over there so the locate i can mention also to you another one on many systems you can use locate so it's a kind of quicker one so but it requires some stuff from the system administrator so the hash for this one should be created in the first place but i mentioned it just to so that you know that this exists and at some point i don't know do we have it on the locate i don't know it's tracking it's not even installed by default on the outer installations but on many workstations on the other installation the dustbin so they have it at home okay so we have find over here so my plan was to also to touch the file archiving and then give the exercise but the exercise we are a little bit too late and this is a good thing because i can actually go and see and take a look at the modified permissions the advanced mode so i will spend now probably 10 15 minutes maybe 10 minutes at most on the advanced permissions and then we will then we will finish a bit early because i also just noticed that i didn't have another break to our clock so you saved for yourself 10 minutes and i apologize for that and then but we will just finish 10 minutes early but we still have 10 minutes to go and let me tell you something about access control list so this feature is not new but it's not yet standard de facto so if you remember i told you about these octets for the user group and the others and then advanced control list acl makes one step further it allows actually setting the permissions for the file the way you want so basically we can have file owners more than one we can have group owners more than one and their permissions can be set in the way we want to the tricky thing over here is that not all file systems support this especially when we are talking about the shared file systems i mean the kind of common local file systems on the linux like ext3 ext4 xfs btrfs what else there as gfs what was the name so they all do it but then for instance if it's something like shared file system and it's shared for some protocol then it could it be a trouble because that depends pretty much on the protocol which is used to share that file system and whether it's support acl or not and that's the issue why when we are talking about permission of users change mod change group change own you mask etc because it's still standard de facto which is used by every single file system even the network file systems but then on the local file systems you can still be okay with the acl acl brings you two commands get faggle and set faggle essentially the first one is to get the parameters for the access list and the other one for setting the parameters for the access list and what's the difference when you do some changes to the file and you will see that at the end of this line there will be plus plus means that access list has been initiated and the changes have been done by default it's not so let's see i for instance get i will try it gets faggle and let me try the hello s page nothing else i can see it's only the standard ones standard users standard group standard others and nothing else okay i want to be for instance i want to set the permissions not only for myself but for someone else let's be a root even if it doesn't matter so root really have access to the editor but i still want to be an owner of that hello s h what i'm doing here so i'm using the special utility for setting up the access list parameters and you can grab the thing from here so there is no need to do anything else and so what i'm saying here please i'm first of all i'm saying that it's the modification mode so i'm modifying modifying the parameters over here then what i'm saying that i'm modifying the user then i'm saying who is the user and then i'm saying what i'm setting for that user so and let it be the full set of parameters so now it's like this let's see what has happened so the notation over here so you've got the plus plus means that something has been done with the access list and now you can see the access list actually has changed a little bit from the previous stage here you have only user group other but here i also got the additional user root and with additional special permissions which is fine in the same way i can do also for the group let me say that i want this known to your vast group and what has happened over here that actually along with my default group also the vast group has got permissions so keep it in mind that on some systems you can use it there are actually quite many things that you have quite many systems you can use it be careful because sometimes when the directory is shared this will not work and you will probably notice that it doesn't work only when somebody will send you an email that there is no access well you're thinking that there should be but anyway that's one of the things to keep in mind that's this kind of things are possible and again so the us with the change more to change group you can modify only the files that belong to you so you can only give access to the user that belongs to you to the group that belong to you or you are part of that group and then also well there are these kind of limitations so so to say that setfackle and getfackle will getfackle it's for everyone but setfackle i would say that's the most efficient in the in the hands of the system administrator so so so so so so so so so so so so so let me see do we have any do we have any good question that we need to still overcome yeah there was very good remark actually on this when you ls again you sometimes you'll see nothing like dash over here like minus over here that means that's the file and then if at the very beginning that's l that's d that means a directory and then if it would be l that means that's a link i can still say if you watch about link because i skipped that part but i can still say so link is something which gives you there was an example uh symbolic link so for instance i want to make a link to a file let it be file new and let it be a name like file new link dummy but anyway and now you can see that actually uh in my current directory i've got the link file new link yeah that was a hard link sorry and now i have to explain you the difference between hard link and symbolic link so the hard link imagine that every single file it's just the object it's just this storage object in the sense that there is only some some special place on the physical device on the physical hard drive where this piece of the information is kept and from the file system point of view you can make links hard links we call it in the sense that you just make a point from this directory from this file name to that information or from this file name to exactly the same information and this is what i've said you okay then the number of links is uh that's the that's the number that comes after the permissions so basically you know that to the same file so the same portion of information on the physical hard disk there are two pointers from different places and in my case i have created the ln uh a link from the uh a link to the same place from the file new a file new link from the from the parent directory i can do also a symbolic link let's do it locally same link as a test so now you can see that actually i have created the same link which not really a pointer to that information but pointer to a pointer so that's a little bit more complicated but that's the two different options and here exactly what you see when you see this minus this l without the minus l without the d so that means that the object that you are looking at is a symbolic link in case of symbolic link in case i i'm removing the file new for instance over here you can see that the symbolic link will simply become broken so file new doesn't exist anymore but this sin sullings or sullings okay still exist but it just doesn't leave me anywhere so there is no there is nothing behind that yeah and then on the top of that if you look at the hard link what was it file new hardly it's still there simply because that was a pointer to actually to the object but you can see now that the links to the same object has been left only one i know it's a little bit complicated i know and this is exactly why i was trying to avoid this explanation but anyway now you know because somebody has asked so it's not me it's somebody who has asked okay now we are pretty much done and since they can take out that 10 minutes break wasn't taken so we are pretty much in time see you tomorrow tomorrow we will come back to this several activities we will come back to the uh exercises we will look at the file transfer we will look at the archivation and then we will look at different utilities and then how to work with the input and output whether it's pipes then there will be grouping then there will be some bullions and then finally we go to the grip and there will be another one exercise so we still have pretty much a decent portion to do for tomorrow as well but that's it will be interesting okay anyway so it's done for today feel free to leave feedback or yet ask something on the notes notes will stay there anyway for today for tomorrow so if something will remain unanswered we will do this otherwise see you tomorrow guys and girls