I have a folder
d------r-T 41 root root 4096 Apr 26 21:17 udp_folder2
when I'm with user other than
root, I can't
cp -r it into a new folder
it says: Permission denied
why? and how can I copy it with a user other than
That would be because the way your current permissions are set, no one can move that file. ( Other than root, because root doesn't follow the same rules. )
You would need to either change the owner of the file (chown), OR add the other user to the group 'root' and chmod it so the group can execute on the directory, OR allow everyone else to execute the file.
So, a quick fix would be:
That will give everyone the ability to read, write and execute on that directory.
Also... if you're attempting to copy 'udp_folder2' into the same directory that it is located now, you'll need the 'w' permission on that directory as well. For example:
/foo/udp_folder2 - you'll need 'w' on /foo to copy that directory in /foo
I'd suggest learning linux file permissions: Linux File Permission Tutorial
The directory has no
Read up on Unix file/directory permissions. It isn't too hard, and you will need it.
You don't want to give everyone
Here's a break down of the numbers:
Then you have 3 groups:
So, if you want to give the owner
To copy folder where owner doesn't have permission to it, you've to change these permissions.
If the folder is restricted even for the owner, there is some reason for it and giving the permissions for everyone else (
For folder to be accessed by the owner, it needs to have read (
So basically to give the reading permissions to the folder recursively, you've to run:
If you're running above command as a user, prefix with
If some files within the folder aren't owned by root, change it recursively by:
Then copy it as usual or use
For more explanation about above commands, check: