Recently I tried to move a directory that I own to another directory (which I also own), but I couldn't. I then noticed that I don't own the parent directory.

This made me wonder what are the rules for moving a directory in UNIX. Do you need to have read/write permissions to both it and its parent? Also what happens if it contains files or directories that you don't own?

1 Answer 1


Your user needs write/executable (wx) permissions on directory to make create/delete any files in it (even if you don't own them and don't have read permissions). There is no need in owning it.

Thus to move directory you need to have wx premissions on parent directory to be able to operate with files and dirs in it and wx on directory you're going to move and on all nested directory (permissions on files in it don't matter at all, if you're not going to change them).

  • 2
    Small mistake: you do not need the read permissions for a directory, only x ("descend") and w ("write"). Test it with chmod 300 test && mv test/{a,A}
    – Lekensteyn
    Jul 6, 2012 at 10:06
  • In order to move /a/b to /a/c/b I needed write permission on b itself. Not sure why. Could it be because of the . and .. entries in b ?
    – YoungFrog
    Dec 12, 2018 at 9:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .