How do I restore permissions of my files?
I ran the command sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
and it changed the ownership of /usr/bin/sudo
. I know it's stupid I was so sleepy I thought $(npm config get prefix)
was not /usr
. After that sudo
so failed. I fixed it by running chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
as a root. My question is how should I restore the ownership of all files under /usr/
? I am guessing it affected all the files under /usr/
. Who owns all the files under /usr/
? Doing sudo ls - /usr
here's the output:
dr-xr-xr-x. 2 myusername root 57344 Oct 15 11:11 bin
drwxr-xr-x. 2 root root 4096 Feb 4 2016 games
drwxr-xr-x. 49 root root 4096 Oct 12 19:54 include
dr-xr-xr-x. 74 root root 20480 Oct 15 11:11 lib
dr-xr-xr-x. 170 root root 118784 Oct 15 11:11 lib64
drwxr-xr-x. 44 root root 12288 Oct 15 11:11 libexec
drwxr-xr-x. 13 root root 4096 Sep 3 22:21 local
dr-xr-xr-x. 2 root root 20480 Oct 12 07:45 sbin
drwxr-xr-x. 296 myusername root 12288 Oct 12 19:56 share
drwxr-xr-x. 4 root root 4096 Sep 24 07:30 src
lrwxrwxrwx. 1 root root 10 Feb 4 2016 tmp -> ../var/tmp
I'm a linux newbie, pls be elaborate with your answer, thanks!