文件属性 chattr

========================================================

文件权限管理之: 文件属性
注:设置文件属性(权限),针对所有用户,包括root
[root@localhost ~]# touch file100 file200 file300
[root@localhost ~]# lsattr file100 file200 file300
-------------e- file100
-------------e- file200
-------------e- file300

[root@localhost ~]# man chattr
[root@localhost ~]# chattr +a file100
[root@localhost ~]# chattr +i file200
[root@localhost ~]# chattr +A file300

[root@localhost ~]# lsattr file100 file200 file300
-----a-------e- file100
----i--------e- file200
-------A-----e- file300

[root@localhost ~]# echo 111 > file100 //以覆盖的方式写入
bash: file100: Operation not permitted
[root@localhost ~]# rm -rf file100
rm: cannot remove `file100': Operation not permitted
[root@localhost ~]# echo 111 >> file100 //以追加的方式写入,例如日志文件

[root@localhost ~]# echo 111 > file200
bash: file200: Permission denied
[root@instructor ~]# echo 111 >> file200
bash: file200: Permission denied
[root@localhost ~]# rm -rf file200
rm: cannot remove `file200': Operation not permitted

[root@localhost ~]# chattr -a file100
[root@localhost ~]# chattr -i file200
[root@localhost ~]# chattr -A file300

最新文章

  1. 张小龙宣布微信小程序1月9日发布,并回答了大家最关心的8个问题
  2. Nginx+Tomcat+Redis实现负载均衡、资源分离、session共享
  3. Cocos2d-x 3.2 学习笔记(五)Sprite Node
  4. “K米” 软件产品评测
  5. 修改ubuntu DNS的步骤/wget url报错: unable to resolve host address的解决方法
  6. 烂泥:KVM安装centos6.5系统
  7. 第一篇 SQL Server代理概述
  8. 全注解的SSH框架
  9. UVa 400 Unix Is
  10. MySQL字符串类型转换时间类型
  11. 157. Read N Characters Given Read4
  12. Solr集群的搭建以及使用(内涵zookeeper集群的搭建指南)
  13. JS 导出图片,toDataURL
  14. web前端学习就这9个阶段,你属于哪个阶段?
  15. 视频直播技术(七):Ijkplayer切换网络时停止播放的问题处理
  16. EasyUI中tree,Datagrid,pagenation的使用EasyUI中Datagrid和pagenation进行关联时,再次点击pagenation时让表格数据显示的问题
  17. STM32F103 ------ BOOT0 / BOOT1
  18. django自定制Admin
  19. SharpSvn 调用在运行时提示加载程序集出错,或有依赖项
  20. 【Unity】6.4 Transform--移动、旋转和缩放游戏对象

热门文章

  1. git克隆源码时提示fatal: HTTP request failed怎么办?
  2. 设计模式总结(转自CS-Notes)
  3. 未能加载文件或程序集“System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKe
  4. P3273 [SCOI2011]棘手的操作
  5. 题解—— 洛谷 p1993 小K的农场(差分约束&负环判断)
  6. Python实现机器学习算法:线性回归
  7. 解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题
  8. algorithm.sty not found error in LaTeX 解决方法
  9. 【译】第37节---EF6-异步查询和保存
  10. 五、IO编程