Cannot delete audit logs with sudo

Posted by DazSlayer on Super User See other posts from Super User or by DazSlayer
Published on 2012-10-10T03:07:48Z Indexed on 2012/10/10 3:40 UTC
Read the original article Hit count: 417

Filed under:
|

I am using auditctl to log all commands run on my Ubuntu system and I working on a script that parses the log into a more readable format. Since these logs tend to become very large, I want to periodically delete the logs. I found that by running

sudo rm /var/log/audit/*

I would get

rm: cannot remove `/var/log/audit/*': No such file or directory

however by running

sudo su
rm /var/log/audit/*

The logs would be deleted without any problem. What could be the cause of this?

© Super User or respective owner

Related posts about permissions

Related posts about logging