Was check what permission are said for our script.
Firstly I will clear the screen and then using as Desch L command a list and dedicatory dish out is
argument to outlasts command and it shows us our extended information about files and directories such
as permission and ownership because we don't want to display extended information about all files in
the current directory.
And we can use another argument to ask someone to specify the file.
It means that we will see information only about that file.
So I am typing out as.
And the name of our script
now you see on the informations about our script but doesn't it.
Permission means in Unix like systems the permissions of files are divided into three categories.
First category means permission for owner of that file.
Second category is group permission and it tells us that all users of that group will have following
permissions.
So the category is for the others which are not part of first two categories.
But let's quickly talk about characteris permission field araw means that it's permission to read permission
then read that file.
W means write permission where it can write to that file without the right permission.
We couldn't even create our first script X means execute permission and whoever has it together with
the permission then can execute that script if we want to change file permissions.
We need to use change mode command by typing change mode.
A plus X followed by the screen name we granting execute permissions for all users.
He had a correct means for all three categories change permissions plus X means a grand exit but emissions
by typing ls command we can ensure that exec permissions has been added.
If you want to move permissions we can use the same command except for a plus sign we use mimes.
Here we can see that execute permissions is missing.
Just for the recap type.
The exact same commands.
Unsure what changes are made to file permissions.
Do remember how I told you about three permissions categories.
We can't of course change permissions only for specific category but start with the file owner by typing
changement you plus x.
I will change permissions only for the file owner.
Here we can see that execute permissions for file owner is present.
Now we also change permissions for a group file owner.
We will do that by typing changement
G plus X
by typing ls command we can see that execute permission is present here to change permission for others
we'll use changement all plus X by typing ls command.
We can see that ex-secret permission is also valid for others.
It is also possible to change permission using numeric value Rait permission represents.
Number four write permission.
Represent.
Number two execute permission represents value 1.
For example if you want to put forth file only the maximum permissions it voodoo represents number 7.
And if you want to give someone only three permissions it would be the number for number six would then
I represent possibility to read.
And right now by typing Chaiyaphum thought 644.
I am removing execute permissions from our script and we can see it right now
if I want to grant back exec with permission I would type change mode 7 5.
And by that I am granting again exec permission.
Throughout the course I will be mostly using changement a class X which is granting execute permission
for everyone.
So if you remember only that it is enough for you and you are good to go.
We have now said the permissions so we can finally run the script to do so type dot slash followed by
the script name and it's running great but what does dot slash means by typing that we are telling that
we will invoke descript in current directory.
This is the most common way to run the script but there is another option to use or pop.
We just prepend the output of B W D command before our script name.
Another option how to run the script is by editing and vitamine variable called Pop.
We can display content of Foth variable using echo command.
If the directory that the script is located is included in the variable path we can invoke the script
only by typing its name to add something to pop.
The use command export
Export pop echo
Dallara pop call on and for part two directory that the is located.
If we are now at the directory where script is located we can use command B W D instead.
Now I can see that home Richard was added to pop.
Great now I can run the script only by calling it name.
I check it and it's working perfectly to check that it is working from everywhere.
I will switch to another directory and call script again.
It is working.
But here I can see that output of our command is not to display.
It's because in my current directory there is nothing to display.
So switching to some not empty directory should be enough
so I will go once the back and switch to another directory.
Now I can see also the output of ls command.