Changing file permissions using chmod command
suggest changeNotice, that in order to change file prmissions, your device need to be rooted, su
binary doesn’t come with factory shipped devices!
Convention:
adb shell su -c "chmod <numeric-permisson> <file>"
Numeric permission constructed from user, group and world sections.
For example, if you want to change file to be readable, writable and executable by everyone, this will be your command:
adb shell su -c "chmod 777 <file-path>"
Or
adb shell su -c "chmod 000 <file-path>"
if you intent to deny any permissions to it.
1st digit-specifies user permission, 2nd digit- specifies group permission, 3rd digit - specifies world (others) permission.
Access permissions:
--- : binary value: 000, octal value: 0 (none) --x : binary value: 001, octal value: 1 (execute) -w- : binary value: 010, octal value: 2 (write) -wx : binary value: 011, octal value: 3 (write, execute) r-- : binary value: 100, octal value: 4 (read) r-x : binary value: 101, octal value: 5 (read, execute) rw- : binary value: 110, octal value: 6 (read, write) rwx : binary value: 111, octal value: 7 (read, write, execute)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents