How do you change permissions on a directory of file?

Answer Posted / bhaskar

To change permission on a file we can use chmod command.
Only thing to remember that to change a file permission one
must be the owner of that file or root in that system.

the typical format of chmod is

chmod <permissions> <filename(s)>

e.g. chmod +777 examplefile

The above command will provide read, write and execute
permission to all in the file examplename.

value for read is 4
write is 2
execute is 1

now to give all permissions it becomes 4+2+1=7

first digit refers to the permission of the owner.
second digit refers to the group permission and last digit
refers to permission to all

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is kali linux illegal?

442


Are linux and unix the same thing?

457


What is the difference between linux and bsd?

422


How do you start a job on background?

465


How to stop a process running in linux?

452






What is semaphore h?

463


How mutex is implemented in linux?

460


How to enhance the security of password file in linux?

447


How to make usb bootable?

514


Does apple use linux?

451


What is the pipe in linux?

462


Which file would you examine to determine the levels of messages written to system log files?

563


How to identify which shell you are using?

459


What is echo $path in linux?

483


Why linux is the most secure?

443