问题
服务器提示硬盘不够了,打开服务器看了下,发现/val/log下面两个文件比较大
清空echo > message
提示
-bash: messages: Operation not permitted
解决方法
[root@host log]# lsattr messages
-----a---------- messages
[root@host log]# chattr -a messages
[root@host log]# lsattr messages
---------------- messages
[root@host log]# echo /dev/null > messages
[root@host log]# ls -lash messages
4.0K -rw-------. 1 root root 10 Mar 6 16:57 messages
[root@host log]# chattr +a messages
[root@host log]# lsattr messages
-----a---------- messages