2016-02-16 08:14:30 +00:00
|
|
|
# chattr
|
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
> Change attributes of files or directories.
|
2021-07-09 15:45:55 +01:00
|
|
|
> More information: <https://manned.org/chattr>.
|
2016-02-16 08:14:30 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
- Make a file or directory immutable to changes and deletion, even by superuser:
|
2016-02-16 08:14:30 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
`chattr +i {{path/to/file_or_directory}}`
|
2016-02-16 08:14:30 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
- Make a file or directory mutable:
|
2016-02-16 08:14:30 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
`chattr -i {{path/to/file_or_directory}}`
|
2016-02-16 08:14:30 +00:00
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
- Recursively make an entire directory and contents immutable:
|
2016-02-16 08:14:30 +00:00
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
`chattr -R +i {{path/to/directory}}`
|