chattr
ファイル属性の変更
ファイル削除できないように変更
属性変更なし
# touch test01.md # ls test01.md test01.md # rm test test/ test01.md # rm test01.md rm: 通常の空ファイル `test01.md' を削除しますか? yes ls test01.md ls: test01.md にアクセスできません: そのようなファイルやディレクトリはありません
変更不可属性を付与(+i)
# touch test01.md # ls test01.md test01.md # lsattr test01.md ---------------- test01.md # chattr +i test01.md # lsattr test01.md ----i----------- test01.md # rm test01.md rm: 通常の空ファイル `test01.md' を削除しますか? yes rm: `test01.md' を削除できません: 許可されていない操作です