Executable script
- Input
- 755
- Expected output
- rwxr-xr-x
7 = 4+2+1 for the owner; 5 = 4+1 for group and others.
chmod 755 vs 644
Type 755 or 644 in the Calculator tab and watch the toggles, the ls -l text and the ready commands. The rule of thumb fits on one line: folders and programs at 755, regular files at 644.
7 = 4+2+1 for the owner; 5 = 4+1 for group and others.
6 = 4+2 for the owner; 4 is read only for the rest.
Turns execute on for all three at once.
Same as going back from 664 to 644.
X only turns execute on for folders or for files that already had x.
The 7 gives the owner read, write and execute (4+2+1). Each 5 gives group and others read and execute (4+1), without write. On files it is the mode of programs and scripts; on directories it lets everyone list and enter, but only the owner create and delete items. ls -l shows rwxr-xr-x.
It works, but it gives execute to files that should never run, such as images and HTML. The right split is 644 for files and 755 for folders; the calculator shows the two find commands that apply that to the tree.
It lacks x. Without execute on the folder you cannot enter it or reach items, only see the names. The calculator warns when a folder has read without execute.
Then that user falls under others (or group, if it belongs to the file group). With 644 and 755 it reads and executes, enough to serve files. It only needs write where the program writes, and there the fix is owner or group, not 777.
Accepts rwxr-xr-x, -rwxr-xr-x or clauses such as u=rwx,g=rx,o=.
644: regular file. The owner reads and writes, everyone else only reads.
chmod 644 arquivochmod u=rw,g=r,o=r arquivochmod -R 644 pasta/find . -type f -exec chmod 644 {} +find . -type d -exec chmod 644 {} +install -m 644 origem destinomode: '0644'RUN chmod 644 /caminho/arquivoCOPY --chmod=644 origem destinogit update-index --chmod=-x arquivoFollows POSIX and GNU chmod (tested on coreutils 9.4). BSD, macOS, ACLs and mounts such as FAT or NTFS may behave differently.