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

What is semaphore explain with example?

431


Is everything in linux a file?

440


What is the role of kudzu?

472


How can we describe a stateless linux server and what are its features?

519


Which linux is easiest to use?

471






What is the scripting language used in linux operating systems?

452


How to uninstall software with the command line in linux?

462


Tell us the difference between telnet and ssh?

494


How do you check permissions of each directory to a file?

469


Is linux the future of gaming?

441


What is critical section linux?

507


What is a shebang line?

476


Does kali linux need antivirus?

467


What is deadlock example?

465


Do you need antivirus with linux?

527