Permissions required to move file to different directory in Unix/Linux [closed] Permissions required to move file to different directory in Unix/Linux [closed] linux linux

Permissions required to move file to different directory in Unix/Linux [closed]


Actually, moving a file is either a rename of a file on a single file system or creating a copy and deleting the original (typically only done if the move is a migration from one file system to another).

In either case you need execute and of course write permissions to the target directory and the source directory. However, for a mere rename (and moving from one directory to another can be just that) on a single file system you do not need any permissions on the file itself. It can be cleared of all permissions and still you can move (rename) it (as long as you have write and execute permissions for the directories).

For a real copy (as it is needed when you move the file to a different file system), you need read permissions on the file itself. No write permissions on the original are necessary, as deletion of a file is not writing to it (but to the directory it is in).