chmod Flashcards
chmod
chmod changes the file mode bits of each
given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits.
chmod
- c
- f
- v
- R
–no-preserve
–preserve-root
–reference=RFILE
- c, –changes, Like verbose but only when a change is made.
- f, –silent, –quiet
- v, –verbose
- R, –recursive
–no-preserve-root, Do not treat ‘/’ specially (default)
–preserve-root, Fail to operate recursively on ‘/’
–reference=RFILE, Use RFILE’s mode instead of MODE values.
chmod [MODES]
[ugoa] [-+=] [rwxXst]
[user(u), group(g), others(o), all users(a)]
[Remove permission(-), Add permission(+), Add permissions and remove unmentioned permissions(=)]
[ read(r), write(w), execute(x) or search(directories), execute/search directory(X), set user or group ID on execution(s), restricted deletion flag or sticky bit(t)
Numeric Mode: 1-4 (0-7) digits.
[0]000 - The first digit selects the set user ID (4) and set group ID (2) and sticky (1).
0[0]00 - The second digit sets user/owner permission read (4), write (2), execute (1).
00[0]0 - The third digit sets group permission read (4), write (2), execute (1).
000[0] - The fourth digit sets other users permission read (4), write (2), execute (1).