设为首页 加入收藏

TOP

chattr用法
2017-10-13 10:32:48 】 浏览:2587
Tags:chattr 用法

  

[root@localhost tmp]# umask
0022

一、chattr用法

1、创建空文件attrtest,然后删除,提示无法删除,因为有隐藏文件

[root@localhost tmp]# cd /tmp

[root@localhost tmp]# touch attrtest
[root@localhost tmp]# chattr +i attrtest
[root@localhost tmp]# rm attrtest
rm: remove regular empty file ‘attrtest’? y
rm: cannot remove ‘attrtest’: Operation not permitted

2、将文件attrtest的隐藏属性取消

[root@localhost tmp]# chattr -i attrtest
[root@localhost tmp]# ls
attrtest hsperfdata_root install ks-script-3CWMoc systemd-private-810f661cb5d247129113c096f86d7db2-cups.service-fEKfSx test2 testtouch vitest yum.log

3、删除attrtest文件,发现可以删除

[root@localhost tmp]# rm attrtest
rm: remove regular empty file ‘attrtest’? y
[root@localhost tmp]# ls
hsperfdata_root install ks-script-3CWMoc systemd-private-810f661cb5d247129113c096f86d7db2-cups.service-fEKfSx test2 testtouch vitest yum.log

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇配置文件和配置表定期备份小工具 下一篇孤儿进程、僵尸进程和守护进程

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目