Hey friends and welcome back. Now in this series we are going to discuss another new topic that is permissions. Actually, there are two types of permissions, file permissions and directory permissions in file permissions that you can restrict access for the files users access for the files groups and the access for everyone else. And in directory permissions is same for that free and for this therefore, scenarios like for symbols to be exact, R, R for read w for write and x for execute and dash for no permissions. So let's start with r1. That our what is our actually our means read which I told you before is able To read a file or list are directories contained, who can create lists can modify or remove anything can be done when this permission is right.
And for execute, it means a permission to execute a program or change into a directory and do a long listing of the directory. And for dex it means no permissions, which we are going to write when there is no option either for our either for W or x. So let's start. Let me show you something before starting. Firstly open terminals and terminals. We're going to write LS minus L. As you can see here, this left side something else WX are access dash.
So what is this all about? Actually, this permissions is divided into three categories. first condition category is, same user is the current user. There's three lines, okay three, okay. Then from here to here, this permissions is for groups. And from here to there here.
This is for others. Okay, I hope you understand what I want to say this is the name of foil. Let's create a file and set up permissions using two methods of setting permissions. One is symbolic method and other one is numerical method. The one which I like the most is no macro method. We'll tell you why later on so let's start with some bullet matter okay again firstly we have to create a file to create a file then write A, B C D that's it next section, which means it is a binary file.
Let me show you versus current petition ABCD here is ABCD. And till now, without doing nothing, the permissions for same user is that he cannot read as well as right but can execute. And this version is same for groups also, but the others users can just only can read it. Okay, mistake is able to see that clearly there is a file ABC exist. Okay, now I'm going to change this permissions. Okay?
So for changing the permission, that thing which I'm going to write, and then the command which I'm going to use is ch mod with the teens more. See, ah that's it. And as I told you before, I mean St. W means write x means execute and dash no permissions that keep in mind okay. And one more things which I wanted to say, add in this symbols, you means users, g means groups and all means others. I hope you understand. Again, I want to repeat okay.
Humans users, g means groups. All means others. Are means read. W means write. Then comes x Miss, execute and dash Miss no permission. Okay, so let's start with leads I first going to write these more than you have to use to change permissions and offer writing this you have to write one by one or specifically you, you means this current user plus is used that we are allowing that permission.
In our case, u plus W, it means that I'm granting this current user to right, okay, and comma, then write g, o, here g means group and omens others, okay? And I just want to remove the right permission from them. So for ads permissions you can use plus symbol and for removing the permissions you have to use negative minus and then W and after all this you have to write the name of file, which we are creating right now A B C D again I am going to run that forum on that command ABCD one previously let me show you rW rW R. Now, what I had met Now, now, I had given a nothing changed here of current user, but you can see clearly Firstly, there was a write permission to this group. But now, I denied this version from group as you can see the blue is not there, there is no permission dashes there Similar now, I want all of them all of them have what have all permissions to be use graphical symbolic Mateo ch mo d u GO plus r a blue x and the name of a BCD accident.
Now, you can easily find out that the file which I have created this ABCD one having all permissions, rW x rW x in our Ws, this for current user, this for groups and this for others. You can either do it By using pneumatic monitor, so, before performing pneumatic matter, just remove all the permission from them. As you can see, this old thing is convert into dash dash. Simple, right? This means if this had nothing, no permissions. Okay, now I'm going to use our new Mac thing no matter which I love the most, because let me tell you after writing this command, CH mod, then comes 777 says my lucky number and the name of your file A, B, C, D. Okay?
Now see the magic. All this dash one converts into a complete formula To all categories, users, groups or groups. So, what is seven seven here? actually four means for four to read that interest in like 444 read to four right and one for execute note that for for read twofold right and confer execute. Now some this three numbers four plus two plus one that means seven. If the, if I had written seven, this means the this same user having all the permissions similarly for groups and similar for others in case I just want only Read and Write permission not execute permission for that you're correct six because four plus three equal to six, we detected that plus one that means execute from here to for that 666.
Let me show you how it will look like 6666 I don't know. I don't know the execute bar permission is removed from each categories. Now comes I only found read. For that I have to write just 444 and see the magic only are our eyes there and I just want only execute or that 111 Hope you understand what I mean to say to set the positions or sorry to set the permissions you can use either symbolic mentor, which is also great. And you can also use numeric matter for domain manager you have to keep in mind that 443 to four years right and one for you execute operations, store permissions and in submit lick matter are means read w means what right x means execute dash with no permission This is all and you for users, g4 groups over others, plus for adding permissions to them and minus for trim decline the permission from them.
Okay, so this is all about file permissions which I had shown you know, the other thing which I'm going to discuss in this series, On in this part of space only the command line shortcuts is. In this I'm going to discuss a file called Ling go fabulous uses of TAB key, and many other things that start. So, let's start with five Goblin. While Goblin actually the first starting Goblin, I want to tell the court is cuddling actually drop clothing, dropping his clothing. clothing is a wild card expansion. Just like regular expressions in all programming languages, Python programming language.
In regular expressions, there are some symbols like stars, then dot, many others like that. Here we're going to use their symbols on So let's start. Suppose I don't know there's only one text file, let me create at least three txt file to understand this example variable, m e, x d. Now, you can see, there are three files, and not three, four, actually four is there, ABC, A, B, C, D, F and G Ha. Now I'm going to use globing by Google just write an asterick dot d x d not here, extract means for all for all means that the file with extension GST will be selected as I'm using RM function RM comma command, which means it will remove that file. Let me show you just press key actually the move represented by ABC dot txt you can see that ABC only remove that produces What happened?
Yeah, nothing is affected here because the permission was set. I can do nothing. So to delete it, we have to change the permission, I'm not going to change again the permissions I do look forward. Now as you can see that other than this fine like ABC dot txt t f dot DST gh eight dot txt is removed from using this expressions as to dot txt. Actually this corner also deleted but this permission is set. That's fair.
And there is nothing happened to this file. So don't worry about that. Look at this expressions. Yeah, a strict means for all means this one, this one, this one and this one. Okay. Other than a strict there's a symbol question mark.
Now you're thinking this, what is the uses of kosher muck that we create File gha again not anxious right? odd him again I want to remove this file and I don't know the starting name of a file. Okay? I'm just write question mark and I know that the file ends with a little dot t x t because I'm targeting that file only. Julie g h i wanted to do Cool See? Yeah.
Actually what is going to happen here is that it is selecting this think means I used here it is considering there is only one lecture here like pictures and videos being i vi, there's why the folders is selected, not this file is selected. Okay. Oh, I hope you understand what I'm going to see. Okay, other than that, there's Another, we will bring math symbols, like you can write a number 09. And in here, or either you can write ABC to simplify your expressions. Nine, I'm going to show you another thing.
Very interesting thing. Suppose I have a box and then press tab. What is it is written automatically this autocomplete features is done by using or pressing our TAB key. Okay. show you another touch, okay. And again, I'm going to press the step touch is auto completed.
This autocomplete feature is only 10 by just pressing it Back key interview for the most interesting thing, yeah, that's right equal here. Comma. Hi. My name is Brandon. That's my name. And presenter.
Actually I created a file. Don't bother about it just showed this equal actually equal means to print and as you can see on screen is printed strings which are written under this. colons Hi, my name is bronzer and it is written to string, okay? Other than that, if you want to Let me show eco. Why. Colliver SS one comma three comma five as you can see here when I had to use this LS function, they were no one file 515355 But now, when I will take this thing you can see here Oh yeah, file one file 355 these are actually do right 515355 you can shorthand your string portion just using curly braces.
Some more trees which I want to discuss here is Like, if you want to copy something inside your terminal, just press Ctrl plus Sif and then plus C and to paste it Ctrl Shift v. Actually there is no command like that 5135 there's a string command not found. Now, if you want to have another tab inside your terminal Ctrl Shift T and the tab is open. Now if you want to switch from, you know this tab with this tab, again, return for there, just use Ctrl Shift V to paste on page based on patient based on to switch your tabs inside your terminals, okay? If you don't press Ctrl and Shift and then pager and just pressing page of BS down it will just show you history of your phone lines. Yeah, one more thing. Another important command that is alias is in my previous video I had discussed this feature.
Let me show you how it works. P is equal to Now I had given this gal or nickname that his peers. Now whenever I would call three years It works like calendar and you can use this calendar or they can use because it was the same I had just Given a nickname for girl or a nickname or you can say another name a simple name okay. This is not basically for short commands like which I had to use the L the commands like like that see a small one one ABCD This is too big for that you can just try areas then yeah as it is string Don't forget to add this thing okay and then put a call and again inside this you have to write your command which you want to have a nickname or to have to became into alias So, this is all about I discuss permissions Firstly, it is good permission that some shortcut keys then discuss about areas, five low being, and many more things to switching one from here to here.
Other thing which I'm going to have is to create ourselves scripts. For that you have to open up, create a file using GG, it is very easy to use a text engine. I had already discuss about this right? example assets recon open a new file named example.sh. And you have to just right this first time You can call it a C bang, okay. Then for insert scripts for adding comment, you can use this hash function.
I just write equal Hello, everyone. Hello everyone. That's it and see if this file was it Actually I didn't put it the conditions here as well as far as not opening right now. Yeah. Now you can see the, the portion where at use hash that was considered as a comment Other than their thing which I had written on that first equal Hello everyone this is displaying here. Firstly, there was my permission, I put the on permissions here set by using 777 discuss you before and just use gatt function.
As you can see it shows all the stuffs which are inside your file named x.sh. Here sh is for your shell script. You can have your phone, you can have your Python. You can also have CSS CSS, z shell scripts. You can also have bash a lot of things. This is a simple example which I have shown is what shell scripts and since scripts you can write the commands like which you write directly on terminal, okay.
So, here it is, as you can see here equal mine Hi my name is bronchial, this is a type Can you can call it is simply a command, okay equals a command and it's just putting down the strings here. So, I had used this shell script to run this command. You can also add date inside it to print the date, etc. Let me so for this Now, it is also showing a date okay I hope you are no understand that what is sells scripts how you can use those scripts actually says script and they uses a system is that when you have to perform a theme task set of commands to be run on various numbers of systems. Suppose, if there is a lab containing a lot of systems 10 to five or 2030s systems and you have to perform five to six commands in our systems.
Then you will go and sit and write that five commands and data gain again you have to go second system and perform the same action this will take Long time, instead of writing that five to six commands, you can write in a shell script and run this all in your system without writing again and again. This will make our task easier, and it also saves our time. So this is the uses of sales reps. So, I hope you understand what is the uses of sales scripts. In my next video, I'm going to further discuss about another topics of origin. So for till now, keep practicing, keep learning, keep growing, and all the best