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? Oct 7, 2015 at 19:03
  • I don't have superuser access, but I believe I have permissions to read & write all the files in both locations. Oct 7, 2015 at 19:05
  • I think for directories you need +x permission so the command can enter the directory. Oct 7, 2015 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 Oct 7, 2015 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. Oct 7, 2015 at 19:21

1 Answer 1


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. Oct 7, 2015 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)? Oct 7, 2015 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/…). Oct 13, 2015 at 17:58

You must log in to answer this question.

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