My TV software setup stopped working recently. I tracked down the issue to a lack of disk space and and ran ncdu to check what was up. Turns out, MythTV logs are consuming nearly 1GB of space on my little SD card. However, attempting to delete any of the log files gives me a Permission denied error, even when using sudo (this in itself confuses me because I thought a super user could do anything).

The owner of the /var/log/mythtv directory is mythtv and the change content permission is set to Only owner. Alas, attempting to change this also yields a Permission denied error.

I have tried logging in as mythtv but I don't know the password because I never set this user up.

I even tried this, which I pieced together from various searches:

sudo -u mythtv find . -maxdepth 1 -name "*.log" -print0 | xargs -0 rm

It also fails with Permission denied.

Can anyone tell me how I can clean up these files?

    Your xargs rm command isn't getting run by the mythtv user, add sudo in front of it to run as a "superuser", like:

    ... | sudo xargs -0 rm

    But do be careful with it, deleting any file can be dangerous. Or use the -u mythtv user option as before.

      Your Answer


      By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

      Not the answer you're looking for? Browse other questions tagged or ask your own question.