Running the command

/data/jritchie$ mv ~/jenkins_dev /data/jritchie/jenkins_dev

I'm getting a bunch of errors like the following:

mv: cannot remove `/home/jritchie/jenkins_dev/plugins/valgrind/WEB-INF/lib': Directory not empty

This is similar to errors returned by rm.

My question is, does this error mean that my files were all successfully moved to the new location, but removing them from the old location failed? Or that they didn't get moved at all? Can I safely remove the old files with rm -r ~/jenkins_dev?

  • did you try sudo mv ~/jenkins_dev /data/jritchie/jenkins_dev, maybe you do not have permissions? – KernelPanic Oct 7 '15 at 19:03
  • I don't have superuser access, but I believe I have permissions to read & write all the files in both locations. – Jacob Ritchie Oct 7 '15 at 19:05
  • I think for directories you need +x permission so the command can enter the directory. – KernelPanic Oct 7 '15 at 19:17
  • I think I also have that permisssion: $ ls -lh ~/jenkins_dev/plugins/valgrind/WEB-INF/ gives total 4.0K drwxr-xr-x 2 jritchie software 4.0K Oct 7 12:06 lib – Jacob Ritchie Oct 7 '15 at 19:18
  • according to your listing, root has all privileges, other users from root group do not have +w permission as all other users. It seems you cannot write into directory therefore files cannot be deleted. – KernelPanic Oct 7 '15 at 19:21

Check to see if there is a file/folder in there that you don't own. Assuming bash and all file names are nicely behaved, something like:

for file in $(find ~/jenkins_dev); do stat -c '%U %n' $file;done | grep -v jritchie

If something pops up then you need to get the owner (or sysadmin) to handle it for you.

  • The result of that command is nothing - all of the files have me as the owner. – Jacob Ritchie Oct 7 '15 at 20:17
  • @JacobRitchie, oic, then maybe the problem is you have files in /data/jritchie/jenkins_dev already and mv doesn't want to merge them (this was suggested in the comments)? – user1717828 Oct 7 '15 at 20:26
  • 1
    Coming back to this a few days later, I think that you were right - there were a few files that I didn't see initially (serverfault.com/questions/201294/…). – Jacob Ritchie Oct 13 '15 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.