Linux Exp 6, 7, 8
Linux Exp 6, 7, 8
Linux Exp 6, 7, 8
Theory:
Instructions: NA
Program: NA
Output:
Conclusion:
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
______________________
Q2. Specify the difference between absolute path and related path.
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
Theory:
Instructions: NA
Program: NA
Output:
Conclusion:
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
______________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
Problem Statement: Study & use of the Command for changing file
permissions. (Both the syntax of chmod numeric and alphabetic)
Numeric Permissions:
CHMOD can also to attributed by using Numeric
Permissions:
400 read by owner
040 read by group
004 read by anybody
(other) 200 write by
owner
020 write by
group 002 write
by anybody 100
execute by owner
010 execute by
group
001 execute by anybody
Examples:
The above numeric permissions can be added to set a certain permission,
for example, a common HTML file on a Unix server to be only viewed over
the Internet would be:
chmod 644file.htm
This gives the file read/write by the owner and only read by everyone
else (-rw-r--r--). Files such as scripts that need to be executed need
more permissions. Below is another example of a common permission
given to scripts.
chmod 755 file.cgi
This would be the following 400+040+004+200+100+010+001 = 755
where you are giving all the rights except the capability for anyone to write
to the file.cgi file(-rwxr-xr-x).
Finally, another common CHMOD permission is 666, as shown below,
which is read and write by everyone.
chmod 666 file.txt
Additional information
Below is an example of how a file may be listed when typing ( ls -l ) at the prompt
as well as information on how to interpret it.
-rw-rw-r-- 1 hope 123 Feb 03 15:36 file.txt
File owner group everyone else links owner size mod date file name
Instructions: NA
Program: NA
Output:
Conclusion:
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
Q2. Which of the following characters specify the user and group category?
a. ‘u’ and ‘g’
b. ‘g’ and ‘o’
c. ‘us’ and ‘gr’
d. ‘u’ and ‘o’
_________________
Q3. Which of the following symbol is used with chmod to assign permission to a
file?
a. –
b. /
c. +
d. *
_________________