I made a mistake. I copied a directory with many sub-directories and files using the sudo command. Consequently only root has permissions to do anything with the files.
Can I somehow duplicate the permissions to root for everyone/myself, in a recursive manner?
Best Answer
Copying things as root will make things become owned by root (gksudo I think is just to stop program settings etc becoming owned by root - see here) - you should be able to fix it using the following :
It:
-R
recursively modifies directories and files$USER
is replaced with your username by the shell (command line, bash etc), so it tells it to make the files' and folders' user and group IDs your user's./<PATH>/<TO>/<COPIED>/<FOLDER>
. Do not do it on just/
,/usr
etc, as it probably will break the system.For example:
The above commands. create a file called
file
, copy it as root tofilert
, then displays the file properties. When files are copied as root, the resulting file should be owned by root - this is what happened to your files. With the above example,filert
can be made usable by a normal user using: