notes/article/os/linux/chattr.md

11 lines
206 B
Markdown

# Protect Specified Folder on Linux
## chattr
Just type the following command to protect your folder or file `$path` from being removed by command `rm` or `sudo rm -rf`.
```bash
chattr -R +i $path
```