Practical Exercise: 3 (User, Group, Permission)

Red Hat Linux Essentials File-System, Directory, Files, User, Group and Permissions
30 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€48.02
List Price:  €67.23
You save:  €19.21
£39.14
List Price:  £54.79
You save:  £15.65
CA$71.63
List Price:  CA$100.29
You save:  CA$28.65
A$80.06
List Price:  A$112.09
You save:  A$32.03
S$67.51
List Price:  S$94.52
You save:  S$27.01
HK$388.46
List Price:  HK$543.88
You save:  HK$155.41
CHF 44.24
List Price:  CHF 61.94
You save:  CHF 17.70
NOK kr563.34
List Price:  NOK kr788.73
You save:  NOK kr225.38
DKK kr358.57
List Price:  DKK kr502.03
You save:  DKK kr143.46
NZ$88.43
List Price:  NZ$123.81
You save:  NZ$35.37
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.45
৳5,964.32
List Price:  ৳8,350.53
You save:  ৳2,386.20
₹4,269.04
List Price:  ₹5,977
You save:  ₹1,707.95
RM224.30
List Price:  RM314.04
You save:  RM89.74
₦77,264.53
List Price:  ₦108,176.53
You save:  ₦30,911.99
₨13,894.99
List Price:  ₨19,454.09
You save:  ₨5,559.10
฿1,708.15
List Price:  ฿2,391.55
You save:  ฿683.40
₺1,759.41
List Price:  ₺2,463.31
You save:  ₺703.90
B$318.75
List Price:  B$446.27
You save:  B$127.52
R937.33
List Price:  R1,312.34
You save:  R375
Лв93.99
List Price:  Лв131.59
You save:  Лв37.60
₩72,848.40
List Price:  ₩101,993.60
You save:  ₩29,145.19
₪182.43
List Price:  ₪255.42
You save:  ₪72.98
₱2,932.41
List Price:  ₱4,105.61
You save:  ₱1,173.20
¥7,857.17
List Price:  ¥11,000.67
You save:  ¥3,143.49
MX$1,008
List Price:  MX$1,411.29
You save:  MX$403.28
QR181.52
List Price:  QR254.14
You save:  QR72.62
P693.18
List Price:  P970.50
You save:  P277.32
KSh6,450.70
List Price:  KSh9,031.50
You save:  KSh2,580.80
E£2,541.20
List Price:  E£3,557.88
You save:  E£1,016.68
ብር6,354.82
List Price:  ብር8,897.26
You save:  ብር2,542.43
Kz45,590.88
List Price:  Kz63,830.88
You save:  Kz18,240
CLP$49,454.60
List Price:  CLP$69,240.40
You save:  CLP$19,785.80
CN¥364.87
List Price:  CN¥510.85
You save:  CN¥145.98
RD$3,040.26
List Price:  RD$4,256.60
You save:  RD$1,216.34
DA6,753.71
List Price:  DA9,455.74
You save:  DA2,702.02
FJ$115.90
List Price:  FJ$162.28
You save:  FJ$46.37
Q384.44
List Price:  Q538.26
You save:  Q153.81
GY$10,442.13
List Price:  GY$14,619.81
You save:  GY$4,177.68
ISK kr6,976.10
List Price:  ISK kr9,767.10
You save:  ISK kr2,791
DH503.31
List Price:  DH704.68
You save:  DH201.36
L920.86
List Price:  L1,289.28
You save:  L368.41
ден2,954.07
List Price:  ден4,135.94
You save:  ден1,181.86
MOP$399.27
List Price:  MOP$559.01
You save:  MOP$159.74
N$928.04
List Price:  N$1,299.34
You save:  N$371.29
C$1,836.54
List Price:  C$2,571.30
You save:  C$734.76
रु6,797.51
List Price:  रु9,517.06
You save:  रु2,719.54
S/185.85
List Price:  S/260.20
You save:  S/74.35
K202.57
List Price:  K283.61
You save:  K81.04
SAR187.71
List Price:  SAR262.82
You save:  SAR75.10
ZK1,381.27
List Price:  ZK1,933.89
You save:  ZK552.61
L239.16
List Price:  L334.85
You save:  L95.68
Kč1,208.85
List Price:  Kč1,692.49
You save:  Kč483.63
Ft19,737.39
List Price:  Ft27,633.93
You save:  Ft7,896.53
SEK kr544
List Price:  SEK kr761.65
You save:  SEK kr217.64
ARS$51,344.11
List Price:  ARS$71,885.87
You save:  ARS$20,541.75
Bs344.88
List Price:  Bs482.86
You save:  Bs137.98
COP$220,596.26
List Price:  COP$308,852.42
You save:  COP$88,256.15
₡25,341.90
List Price:  ₡35,480.70
You save:  ₡10,138.79
L1,268.10
List Price:  L1,775.44
You save:  L507.34
₲389,249.85
List Price:  ₲544,980.94
You save:  ₲155,731.08
$U2,221.61
List Price:  $U3,110.44
You save:  $U888.82
zł204.67
List Price:  zł286.56
You save:  zł81.88
Already have an account? Log In

Transcript

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

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.