What is the default owner of the /var/cache subdirectories?

5 Antworten [Letzter Beitrag]
rytege
Offline
Beigetreten: 10/05/2017

Good afternoon, I have executed the following command by mistake:

sudo chown -R www-data:www-data /var/cache

I want to undo this, so I am asking if anyone may know what is the default owner of /var/cache subdirectories?

Is it root? Should I execute: sudo chown -R root:root /var/cache

Thank you in advance for your sharings.

nadebula.1984
Offline
Beigetreten: 05/01/2018

For most sub-directories under /var/cache, the owner and group are both "root", but with a few exceptions. For example, the owner and group of "man" directory are "man". Normally you can try to re-set them to both "root".

rytege
Offline
Beigetreten: 10/05/2017

Ok :)

Magic Banana

I am a member!

I am a translator!

Offline
Beigetreten: 07/24/2010

/var/cache is owned by root:root and, in theory (not that I have ever tried), you can remove anything inside /var/cache because it is, well, cache data.

CitoplasmaX
Offline
Beigetreten: 11/24/2016

In my case:

root@xxx:~# ls -l /var/cache
total 172
drwxr-xr-x 3 root root 4096 ago 29 2018 apache2
drwxr-xr-x 3 root root 4096 may 10 14:47 apparmor
drwxr-xr-x 4 root root 4096 abr 20 2018 app-info
drwxr-xr-x 3 root root 4096 ago 6 06:41 apt
drwxr-xr-x 7 root root 4096 dic 13 2018 clamav-unofficial-sigs
drwxr-xr-x 2 root root 4096 abr 20 2018 cracklib
drwxrwx--- 3 root lp 4096 ago 6 00:01 cups
drwxr-xr-x 2 root root 4096 jun 29 12:12 debconf
drwxr-xr-x 2 root root 4096 abr 20 2018 dictionaries-common
drwxr-xr-x 2 root root 69632 jul 31 23:06 fontconfig
drwxr-xr-x 2 root root 4096 ago 17 2017 fonts
drwxr-xr-x 2 root root 4096 ago 6 06:40 fwupd
drwxr-xr-x 2 root root 4096 dic 20 2017 gdm
drwx------ 2 root root 4096 jul 29 16:32 ldconfig
drwx--x--x 3 root root 4096 abr 21 2018 libvirt
drwxr-xr-x 2 root root 4096 oct 22 2018 lxc
drwxr-xr-x 37 man man 4096 ago 6 00:00 man
drwxr-xr-x 3 root root 4096 oct 27 2018 munin
drwxr-xr-x 3 root root 4096 abr 20 2018 PackageKit
drwxr-xr-x 2 root root 4096 ene 22 2017 pm-utils
drwxr-xr-x 3 root root 4096 ago 29 2018 postgresql
drwx------ 2 root root 4096 jul 27 2018 private
drwxr-xr-x 2 root root 4096 ago 15 2016 realmd
drwxr-xr-x 3 root root 4096 ago 4 00:06 samba
drwxr-xr-x 2 root root 4096 ago 6 10:50 snapd
drwxr-x--- 2 trafficserver adm 4096 ago 29 2018 trafficserver

Cache directory:

drwxr-xr-x 28 root root 4096 mar 2 11:22 cache

rytege
Offline
Beigetreten: 10/05/2017

Thank you CitoplasmaX for your screen copy :-)