Why do I get permission denied when using mv althrough directory rights are correct?












6















I get permission denied when trying to move folder Music via mv although directory owner is set to my user and user permissions are set to 7. What's going on?



(I know that I could use sudo but I want to find out what's wrong. Something smells fishy here). Ps: I am on Mac OS X El Capitan.



Terminal screenshot









share





























    6















    I get permission denied when trying to move folder Music via mv although directory owner is set to my user and user permissions are set to 7. What's going on?



    (I know that I could use sudo but I want to find out what's wrong. Something smells fishy here). Ps: I am on Mac OS X El Capitan.



    Terminal screenshot









    share



























      6












      6








      6


      1






      I get permission denied when trying to move folder Music via mv although directory owner is set to my user and user permissions are set to 7. What's going on?



      (I know that I could use sudo but I want to find out what's wrong. Something smells fishy here). Ps: I am on Mac OS X El Capitan.



      Terminal screenshot









      share
















      I get permission denied when trying to move folder Music via mv although directory owner is set to my user and user permissions are set to 7. What's going on?



      (I know that I could use sudo but I want to find out what's wrong. Something smells fishy here). Ps: I am on Mac OS X El Capitan.



      Terminal screenshot







      files permissions directory mv





      share














      share












      share



      share








      edited Oct 6 '15 at 23:57









      Gilles

      539k12810911606




      539k12810911606










      asked Oct 6 '15 at 13:31









      TimoTimo

      221125




      221125






















          5 Answers
          5






          active

          oldest

          votes


















          13














          Do note that, when in folder a, moving b to c, the folder permissions of a determine what you can do.



          In this case, the permissions on . will be most important.



          Observe that the permissions are more complex than simply rwx. Your music folder has an @ at the end, the . folder has a + at the end.




          • Use xattr -h to determine the complex permissions for the @ symbol.

          • Use getfacl to determine the ACL for the + symbol.






          share|improve this answer


























          • Do you have a resource that covers "complex permissions", as you call them?

            – user1717828
            Oct 6 '15 at 13:39











          • man xattr might be a good starting point.

            – Konerak
            Oct 6 '15 at 13:51











          • nope, no manual entry. I was able to Google around to find another name for it: extended attributes, if anyone else wants to learn more.

            – user1717828
            Oct 6 '15 at 14:10






          • 4





            Or use ls -la@e. Most likely here, there was a deny delete ACLs that also prevents renaming.

            – Stéphane Chazelas
            Oct 6 '15 at 14:11













          • @user1717828, check the chmod man page on OS/X

            – Stéphane Chazelas
            Oct 6 '15 at 14:13



















          9














          Seems like as if there was at least 1 file somewhere deep in that directory that didn't have right permissions.



          So, what I did was:



          sudo chown -R valmar ./Music
          sudo chmod -R 755 ./Music


          Now it works.






          share|improve this answer



















          • 11





            Whatever the problem was, giving execute permissions to music files should not be the solution.

            – Stéphane Chazelas
            Oct 6 '15 at 16:01






          • 3





            And it seems unlikely that an object in a directory could interfere with your ability to rename that directory.

            – Scott
            Oct 6 '15 at 18:35











          • I know it's weird but that did the trick. Using chmod and chown on the directory itself had no effect.

            – Timo
            Oct 6 '15 at 19:36











          • is it possible that chmod 755 removed the special '@' permissions on the Music folder?

            – HorusKol
            Oct 7 '15 at 3:15











          • @HorusKol, or the chown. The OP's symptoms would match the directories having a deny delete ACLs, but at least on Yosemite, doing a chown or chmod 755 does not delete that ACL. You'd need chmod -a 'everyone deny delete' Music for that. It could be different in El Capitan.

            – Stéphane Chazelas
            Oct 7 '15 at 8:12



















          3














          I had this problem when a set of programs was running in a directory I was trying to remove. In order to move the directory, I had to first kill all running programs from that directory.



          I used the following commands, for reference:



          ps aux | grep -I [NAME_OF_ANNOYING_PROGRAM] | grep -v grep | awk '{print $2}' | sudo xargs kill -9
          sudo mv /usr/local/[NAME_OF_ANNOYING_PROGRAM] /usr/local/[NAME_OF_ANNOYING_PROGRAM]2


          Obviously, [NAME_OF_ANNOYING_PROGRAM] will be different in every case and the directory you're trying to move may be different than the name of the program.



          Either way, the general procedure is:




          1. kill all programs running from the directory in question

          2. attempt to rename directory

          3. if that fails, force kill all programs from the directory

          4. attempt to rename directory

          5. if that fails, see if the program is running again, I.e. that it has been restarted by some daemon program running from a different directory

          6. force kill the daemon program that restarts the annoying program

          7. force kill the annoying program

          8. rename directory

          9. profit






          share|improve this answer
























          • I don't think the OP likely has any programs running from the ~/Music directory. Anyway he said he doesn't want to use sudo, which this answer does.

            – spinup
            1 hour ago



















          2














          I was using Windows Subsystem for Linux. I had the directory open in a different bash instance. Closing it let me move the directory.






          share|improve this answer































            0














            The problem here likely has to do with the Access Control List (ACL) of the Music folder. The ACL is a separate permission system to the regular POSIX ones that are normally listed by ls -l. Some other directories in the Home folder and elsewhere also have ACLs.



            To see the ACLs within the home directory, use:



            /bin/ls -le ~


            You will likely see a rule like 0: group:everyone deny delete for the Music directory. As you noted you could override the problem with sudo. If you don't want to do that (or can't), you have other options, given that you're the owner of the file. You can strip off the offending entry from the Music directory's ACL, based on its index (0 in the example I gave above):



            /bin/chmod -a# 0 Music


            Or you can strip off all entries in the ACL:



            /bin/chmod -N Music


            Now you can move the directory around (subject to the regular POSIX permissions). If you want to put the ACL back after the move, you could use:



            /bin/chmod +a "group:everyone deny delete" Music_tmp


            And use /bin/ls -le again to confirm the ACL is as you want it. Check out the ACL examples in man chmod for more info. In particular, this intro is helpful:




            Each file has one ACL, containing an ordered list of entries. Each entry refers to a user or group, and grants or denies a set of permissions. In cases where a user and a group exist with the same name, the user/group name can be prefixed with "user:" or "group:" in order to specify the type of name.







            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f234278%2fwhy-do-i-get-permission-denied-when-using-mv-althrough-directory-rights-are-corr%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              5 Answers
              5






              active

              oldest

              votes








              5 Answers
              5






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              13














              Do note that, when in folder a, moving b to c, the folder permissions of a determine what you can do.



              In this case, the permissions on . will be most important.



              Observe that the permissions are more complex than simply rwx. Your music folder has an @ at the end, the . folder has a + at the end.




              • Use xattr -h to determine the complex permissions for the @ symbol.

              • Use getfacl to determine the ACL for the + symbol.






              share|improve this answer


























              • Do you have a resource that covers "complex permissions", as you call them?

                – user1717828
                Oct 6 '15 at 13:39











              • man xattr might be a good starting point.

                – Konerak
                Oct 6 '15 at 13:51











              • nope, no manual entry. I was able to Google around to find another name for it: extended attributes, if anyone else wants to learn more.

                – user1717828
                Oct 6 '15 at 14:10






              • 4





                Or use ls -la@e. Most likely here, there was a deny delete ACLs that also prevents renaming.

                – Stéphane Chazelas
                Oct 6 '15 at 14:11













              • @user1717828, check the chmod man page on OS/X

                – Stéphane Chazelas
                Oct 6 '15 at 14:13
















              13














              Do note that, when in folder a, moving b to c, the folder permissions of a determine what you can do.



              In this case, the permissions on . will be most important.



              Observe that the permissions are more complex than simply rwx. Your music folder has an @ at the end, the . folder has a + at the end.




              • Use xattr -h to determine the complex permissions for the @ symbol.

              • Use getfacl to determine the ACL for the + symbol.






              share|improve this answer


























              • Do you have a resource that covers "complex permissions", as you call them?

                – user1717828
                Oct 6 '15 at 13:39











              • man xattr might be a good starting point.

                – Konerak
                Oct 6 '15 at 13:51











              • nope, no manual entry. I was able to Google around to find another name for it: extended attributes, if anyone else wants to learn more.

                – user1717828
                Oct 6 '15 at 14:10






              • 4





                Or use ls -la@e. Most likely here, there was a deny delete ACLs that also prevents renaming.

                – Stéphane Chazelas
                Oct 6 '15 at 14:11













              • @user1717828, check the chmod man page on OS/X

                – Stéphane Chazelas
                Oct 6 '15 at 14:13














              13












              13








              13







              Do note that, when in folder a, moving b to c, the folder permissions of a determine what you can do.



              In this case, the permissions on . will be most important.



              Observe that the permissions are more complex than simply rwx. Your music folder has an @ at the end, the . folder has a + at the end.




              • Use xattr -h to determine the complex permissions for the @ symbol.

              • Use getfacl to determine the ACL for the + symbol.






              share|improve this answer















              Do note that, when in folder a, moving b to c, the folder permissions of a determine what you can do.



              In this case, the permissions on . will be most important.



              Observe that the permissions are more complex than simply rwx. Your music folder has an @ at the end, the . folder has a + at the end.




              • Use xattr -h to determine the complex permissions for the @ symbol.

              • Use getfacl to determine the ACL for the + symbol.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Oct 6 '15 at 22:45









              John Kugelman

              1,65411017




              1,65411017










              answered Oct 6 '15 at 13:37









              KonerakKonerak

              968812




              968812













              • Do you have a resource that covers "complex permissions", as you call them?

                – user1717828
                Oct 6 '15 at 13:39











              • man xattr might be a good starting point.

                – Konerak
                Oct 6 '15 at 13:51











              • nope, no manual entry. I was able to Google around to find another name for it: extended attributes, if anyone else wants to learn more.

                – user1717828
                Oct 6 '15 at 14:10






              • 4





                Or use ls -la@e. Most likely here, there was a deny delete ACLs that also prevents renaming.

                – Stéphane Chazelas
                Oct 6 '15 at 14:11













              • @user1717828, check the chmod man page on OS/X

                – Stéphane Chazelas
                Oct 6 '15 at 14:13



















              • Do you have a resource that covers "complex permissions", as you call them?

                – user1717828
                Oct 6 '15 at 13:39











              • man xattr might be a good starting point.

                – Konerak
                Oct 6 '15 at 13:51











              • nope, no manual entry. I was able to Google around to find another name for it: extended attributes, if anyone else wants to learn more.

                – user1717828
                Oct 6 '15 at 14:10






              • 4





                Or use ls -la@e. Most likely here, there was a deny delete ACLs that also prevents renaming.

                – Stéphane Chazelas
                Oct 6 '15 at 14:11













              • @user1717828, check the chmod man page on OS/X

                – Stéphane Chazelas
                Oct 6 '15 at 14:13

















              Do you have a resource that covers "complex permissions", as you call them?

              – user1717828
              Oct 6 '15 at 13:39





              Do you have a resource that covers "complex permissions", as you call them?

              – user1717828
              Oct 6 '15 at 13:39













              man xattr might be a good starting point.

              – Konerak
              Oct 6 '15 at 13:51





              man xattr might be a good starting point.

              – Konerak
              Oct 6 '15 at 13:51













              nope, no manual entry. I was able to Google around to find another name for it: extended attributes, if anyone else wants to learn more.

              – user1717828
              Oct 6 '15 at 14:10





              nope, no manual entry. I was able to Google around to find another name for it: extended attributes, if anyone else wants to learn more.

              – user1717828
              Oct 6 '15 at 14:10




              4




              4





              Or use ls -la@e. Most likely here, there was a deny delete ACLs that also prevents renaming.

              – Stéphane Chazelas
              Oct 6 '15 at 14:11







              Or use ls -la@e. Most likely here, there was a deny delete ACLs that also prevents renaming.

              – Stéphane Chazelas
              Oct 6 '15 at 14:11















              @user1717828, check the chmod man page on OS/X

              – Stéphane Chazelas
              Oct 6 '15 at 14:13





              @user1717828, check the chmod man page on OS/X

              – Stéphane Chazelas
              Oct 6 '15 at 14:13













              9














              Seems like as if there was at least 1 file somewhere deep in that directory that didn't have right permissions.



              So, what I did was:



              sudo chown -R valmar ./Music
              sudo chmod -R 755 ./Music


              Now it works.






              share|improve this answer



















              • 11





                Whatever the problem was, giving execute permissions to music files should not be the solution.

                – Stéphane Chazelas
                Oct 6 '15 at 16:01






              • 3





                And it seems unlikely that an object in a directory could interfere with your ability to rename that directory.

                – Scott
                Oct 6 '15 at 18:35











              • I know it's weird but that did the trick. Using chmod and chown on the directory itself had no effect.

                – Timo
                Oct 6 '15 at 19:36











              • is it possible that chmod 755 removed the special '@' permissions on the Music folder?

                – HorusKol
                Oct 7 '15 at 3:15











              • @HorusKol, or the chown. The OP's symptoms would match the directories having a deny delete ACLs, but at least on Yosemite, doing a chown or chmod 755 does not delete that ACL. You'd need chmod -a 'everyone deny delete' Music for that. It could be different in El Capitan.

                – Stéphane Chazelas
                Oct 7 '15 at 8:12
















              9














              Seems like as if there was at least 1 file somewhere deep in that directory that didn't have right permissions.



              So, what I did was:



              sudo chown -R valmar ./Music
              sudo chmod -R 755 ./Music


              Now it works.






              share|improve this answer



















              • 11





                Whatever the problem was, giving execute permissions to music files should not be the solution.

                – Stéphane Chazelas
                Oct 6 '15 at 16:01






              • 3





                And it seems unlikely that an object in a directory could interfere with your ability to rename that directory.

                – Scott
                Oct 6 '15 at 18:35











              • I know it's weird but that did the trick. Using chmod and chown on the directory itself had no effect.

                – Timo
                Oct 6 '15 at 19:36











              • is it possible that chmod 755 removed the special '@' permissions on the Music folder?

                – HorusKol
                Oct 7 '15 at 3:15











              • @HorusKol, or the chown. The OP's symptoms would match the directories having a deny delete ACLs, but at least on Yosemite, doing a chown or chmod 755 does not delete that ACL. You'd need chmod -a 'everyone deny delete' Music for that. It could be different in El Capitan.

                – Stéphane Chazelas
                Oct 7 '15 at 8:12














              9












              9








              9







              Seems like as if there was at least 1 file somewhere deep in that directory that didn't have right permissions.



              So, what I did was:



              sudo chown -R valmar ./Music
              sudo chmod -R 755 ./Music


              Now it works.






              share|improve this answer













              Seems like as if there was at least 1 file somewhere deep in that directory that didn't have right permissions.



              So, what I did was:



              sudo chown -R valmar ./Music
              sudo chmod -R 755 ./Music


              Now it works.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Oct 6 '15 at 13:39









              TimoTimo

              221125




              221125








              • 11





                Whatever the problem was, giving execute permissions to music files should not be the solution.

                – Stéphane Chazelas
                Oct 6 '15 at 16:01






              • 3





                And it seems unlikely that an object in a directory could interfere with your ability to rename that directory.

                – Scott
                Oct 6 '15 at 18:35











              • I know it's weird but that did the trick. Using chmod and chown on the directory itself had no effect.

                – Timo
                Oct 6 '15 at 19:36











              • is it possible that chmod 755 removed the special '@' permissions on the Music folder?

                – HorusKol
                Oct 7 '15 at 3:15











              • @HorusKol, or the chown. The OP's symptoms would match the directories having a deny delete ACLs, but at least on Yosemite, doing a chown or chmod 755 does not delete that ACL. You'd need chmod -a 'everyone deny delete' Music for that. It could be different in El Capitan.

                – Stéphane Chazelas
                Oct 7 '15 at 8:12














              • 11





                Whatever the problem was, giving execute permissions to music files should not be the solution.

                – Stéphane Chazelas
                Oct 6 '15 at 16:01






              • 3





                And it seems unlikely that an object in a directory could interfere with your ability to rename that directory.

                – Scott
                Oct 6 '15 at 18:35











              • I know it's weird but that did the trick. Using chmod and chown on the directory itself had no effect.

                – Timo
                Oct 6 '15 at 19:36











              • is it possible that chmod 755 removed the special '@' permissions on the Music folder?

                – HorusKol
                Oct 7 '15 at 3:15











              • @HorusKol, or the chown. The OP's symptoms would match the directories having a deny delete ACLs, but at least on Yosemite, doing a chown or chmod 755 does not delete that ACL. You'd need chmod -a 'everyone deny delete' Music for that. It could be different in El Capitan.

                – Stéphane Chazelas
                Oct 7 '15 at 8:12








              11




              11





              Whatever the problem was, giving execute permissions to music files should not be the solution.

              – Stéphane Chazelas
              Oct 6 '15 at 16:01





              Whatever the problem was, giving execute permissions to music files should not be the solution.

              – Stéphane Chazelas
              Oct 6 '15 at 16:01




              3




              3





              And it seems unlikely that an object in a directory could interfere with your ability to rename that directory.

              – Scott
              Oct 6 '15 at 18:35





              And it seems unlikely that an object in a directory could interfere with your ability to rename that directory.

              – Scott
              Oct 6 '15 at 18:35













              I know it's weird but that did the trick. Using chmod and chown on the directory itself had no effect.

              – Timo
              Oct 6 '15 at 19:36





              I know it's weird but that did the trick. Using chmod and chown on the directory itself had no effect.

              – Timo
              Oct 6 '15 at 19:36













              is it possible that chmod 755 removed the special '@' permissions on the Music folder?

              – HorusKol
              Oct 7 '15 at 3:15





              is it possible that chmod 755 removed the special '@' permissions on the Music folder?

              – HorusKol
              Oct 7 '15 at 3:15













              @HorusKol, or the chown. The OP's symptoms would match the directories having a deny delete ACLs, but at least on Yosemite, doing a chown or chmod 755 does not delete that ACL. You'd need chmod -a 'everyone deny delete' Music for that. It could be different in El Capitan.

              – Stéphane Chazelas
              Oct 7 '15 at 8:12





              @HorusKol, or the chown. The OP's symptoms would match the directories having a deny delete ACLs, but at least on Yosemite, doing a chown or chmod 755 does not delete that ACL. You'd need chmod -a 'everyone deny delete' Music for that. It could be different in El Capitan.

              – Stéphane Chazelas
              Oct 7 '15 at 8:12











              3














              I had this problem when a set of programs was running in a directory I was trying to remove. In order to move the directory, I had to first kill all running programs from that directory.



              I used the following commands, for reference:



              ps aux | grep -I [NAME_OF_ANNOYING_PROGRAM] | grep -v grep | awk '{print $2}' | sudo xargs kill -9
              sudo mv /usr/local/[NAME_OF_ANNOYING_PROGRAM] /usr/local/[NAME_OF_ANNOYING_PROGRAM]2


              Obviously, [NAME_OF_ANNOYING_PROGRAM] will be different in every case and the directory you're trying to move may be different than the name of the program.



              Either way, the general procedure is:




              1. kill all programs running from the directory in question

              2. attempt to rename directory

              3. if that fails, force kill all programs from the directory

              4. attempt to rename directory

              5. if that fails, see if the program is running again, I.e. that it has been restarted by some daemon program running from a different directory

              6. force kill the daemon program that restarts the annoying program

              7. force kill the annoying program

              8. rename directory

              9. profit






              share|improve this answer
























              • I don't think the OP likely has any programs running from the ~/Music directory. Anyway he said he doesn't want to use sudo, which this answer does.

                – spinup
                1 hour ago
















              3














              I had this problem when a set of programs was running in a directory I was trying to remove. In order to move the directory, I had to first kill all running programs from that directory.



              I used the following commands, for reference:



              ps aux | grep -I [NAME_OF_ANNOYING_PROGRAM] | grep -v grep | awk '{print $2}' | sudo xargs kill -9
              sudo mv /usr/local/[NAME_OF_ANNOYING_PROGRAM] /usr/local/[NAME_OF_ANNOYING_PROGRAM]2


              Obviously, [NAME_OF_ANNOYING_PROGRAM] will be different in every case and the directory you're trying to move may be different than the name of the program.



              Either way, the general procedure is:




              1. kill all programs running from the directory in question

              2. attempt to rename directory

              3. if that fails, force kill all programs from the directory

              4. attempt to rename directory

              5. if that fails, see if the program is running again, I.e. that it has been restarted by some daemon program running from a different directory

              6. force kill the daemon program that restarts the annoying program

              7. force kill the annoying program

              8. rename directory

              9. profit






              share|improve this answer
























              • I don't think the OP likely has any programs running from the ~/Music directory. Anyway he said he doesn't want to use sudo, which this answer does.

                – spinup
                1 hour ago














              3












              3








              3







              I had this problem when a set of programs was running in a directory I was trying to remove. In order to move the directory, I had to first kill all running programs from that directory.



              I used the following commands, for reference:



              ps aux | grep -I [NAME_OF_ANNOYING_PROGRAM] | grep -v grep | awk '{print $2}' | sudo xargs kill -9
              sudo mv /usr/local/[NAME_OF_ANNOYING_PROGRAM] /usr/local/[NAME_OF_ANNOYING_PROGRAM]2


              Obviously, [NAME_OF_ANNOYING_PROGRAM] will be different in every case and the directory you're trying to move may be different than the name of the program.



              Either way, the general procedure is:




              1. kill all programs running from the directory in question

              2. attempt to rename directory

              3. if that fails, force kill all programs from the directory

              4. attempt to rename directory

              5. if that fails, see if the program is running again, I.e. that it has been restarted by some daemon program running from a different directory

              6. force kill the daemon program that restarts the annoying program

              7. force kill the annoying program

              8. rename directory

              9. profit






              share|improve this answer













              I had this problem when a set of programs was running in a directory I was trying to remove. In order to move the directory, I had to first kill all running programs from that directory.



              I used the following commands, for reference:



              ps aux | grep -I [NAME_OF_ANNOYING_PROGRAM] | grep -v grep | awk '{print $2}' | sudo xargs kill -9
              sudo mv /usr/local/[NAME_OF_ANNOYING_PROGRAM] /usr/local/[NAME_OF_ANNOYING_PROGRAM]2


              Obviously, [NAME_OF_ANNOYING_PROGRAM] will be different in every case and the directory you're trying to move may be different than the name of the program.



              Either way, the general procedure is:




              1. kill all programs running from the directory in question

              2. attempt to rename directory

              3. if that fails, force kill all programs from the directory

              4. attempt to rename directory

              5. if that fails, see if the program is running again, I.e. that it has been restarted by some daemon program running from a different directory

              6. force kill the daemon program that restarts the annoying program

              7. force kill the annoying program

              8. rename directory

              9. profit







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 15 '18 at 13:59









              WattsInABoxWattsInABox

              1313




              1313













              • I don't think the OP likely has any programs running from the ~/Music directory. Anyway he said he doesn't want to use sudo, which this answer does.

                – spinup
                1 hour ago



















              • I don't think the OP likely has any programs running from the ~/Music directory. Anyway he said he doesn't want to use sudo, which this answer does.

                – spinup
                1 hour ago

















              I don't think the OP likely has any programs running from the ~/Music directory. Anyway he said he doesn't want to use sudo, which this answer does.

              – spinup
              1 hour ago





              I don't think the OP likely has any programs running from the ~/Music directory. Anyway he said he doesn't want to use sudo, which this answer does.

              – spinup
              1 hour ago











              2














              I was using Windows Subsystem for Linux. I had the directory open in a different bash instance. Closing it let me move the directory.






              share|improve this answer




























                2














                I was using Windows Subsystem for Linux. I had the directory open in a different bash instance. Closing it let me move the directory.






                share|improve this answer


























                  2












                  2








                  2







                  I was using Windows Subsystem for Linux. I had the directory open in a different bash instance. Closing it let me move the directory.






                  share|improve this answer













                  I was using Windows Subsystem for Linux. I had the directory open in a different bash instance. Closing it let me move the directory.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 16 '18 at 17:10









                  Chris AndersonChris Anderson

                  1212




                  1212























                      0














                      The problem here likely has to do with the Access Control List (ACL) of the Music folder. The ACL is a separate permission system to the regular POSIX ones that are normally listed by ls -l. Some other directories in the Home folder and elsewhere also have ACLs.



                      To see the ACLs within the home directory, use:



                      /bin/ls -le ~


                      You will likely see a rule like 0: group:everyone deny delete for the Music directory. As you noted you could override the problem with sudo. If you don't want to do that (or can't), you have other options, given that you're the owner of the file. You can strip off the offending entry from the Music directory's ACL, based on its index (0 in the example I gave above):



                      /bin/chmod -a# 0 Music


                      Or you can strip off all entries in the ACL:



                      /bin/chmod -N Music


                      Now you can move the directory around (subject to the regular POSIX permissions). If you want to put the ACL back after the move, you could use:



                      /bin/chmod +a "group:everyone deny delete" Music_tmp


                      And use /bin/ls -le again to confirm the ACL is as you want it. Check out the ACL examples in man chmod for more info. In particular, this intro is helpful:




                      Each file has one ACL, containing an ordered list of entries. Each entry refers to a user or group, and grants or denies a set of permissions. In cases where a user and a group exist with the same name, the user/group name can be prefixed with "user:" or "group:" in order to specify the type of name.







                      share|improve this answer




























                        0














                        The problem here likely has to do with the Access Control List (ACL) of the Music folder. The ACL is a separate permission system to the regular POSIX ones that are normally listed by ls -l. Some other directories in the Home folder and elsewhere also have ACLs.



                        To see the ACLs within the home directory, use:



                        /bin/ls -le ~


                        You will likely see a rule like 0: group:everyone deny delete for the Music directory. As you noted you could override the problem with sudo. If you don't want to do that (or can't), you have other options, given that you're the owner of the file. You can strip off the offending entry from the Music directory's ACL, based on its index (0 in the example I gave above):



                        /bin/chmod -a# 0 Music


                        Or you can strip off all entries in the ACL:



                        /bin/chmod -N Music


                        Now you can move the directory around (subject to the regular POSIX permissions). If you want to put the ACL back after the move, you could use:



                        /bin/chmod +a "group:everyone deny delete" Music_tmp


                        And use /bin/ls -le again to confirm the ACL is as you want it. Check out the ACL examples in man chmod for more info. In particular, this intro is helpful:




                        Each file has one ACL, containing an ordered list of entries. Each entry refers to a user or group, and grants or denies a set of permissions. In cases where a user and a group exist with the same name, the user/group name can be prefixed with "user:" or "group:" in order to specify the type of name.







                        share|improve this answer


























                          0












                          0








                          0







                          The problem here likely has to do with the Access Control List (ACL) of the Music folder. The ACL is a separate permission system to the regular POSIX ones that are normally listed by ls -l. Some other directories in the Home folder and elsewhere also have ACLs.



                          To see the ACLs within the home directory, use:



                          /bin/ls -le ~


                          You will likely see a rule like 0: group:everyone deny delete for the Music directory. As you noted you could override the problem with sudo. If you don't want to do that (or can't), you have other options, given that you're the owner of the file. You can strip off the offending entry from the Music directory's ACL, based on its index (0 in the example I gave above):



                          /bin/chmod -a# 0 Music


                          Or you can strip off all entries in the ACL:



                          /bin/chmod -N Music


                          Now you can move the directory around (subject to the regular POSIX permissions). If you want to put the ACL back after the move, you could use:



                          /bin/chmod +a "group:everyone deny delete" Music_tmp


                          And use /bin/ls -le again to confirm the ACL is as you want it. Check out the ACL examples in man chmod for more info. In particular, this intro is helpful:




                          Each file has one ACL, containing an ordered list of entries. Each entry refers to a user or group, and grants or denies a set of permissions. In cases where a user and a group exist with the same name, the user/group name can be prefixed with "user:" or "group:" in order to specify the type of name.







                          share|improve this answer













                          The problem here likely has to do with the Access Control List (ACL) of the Music folder. The ACL is a separate permission system to the regular POSIX ones that are normally listed by ls -l. Some other directories in the Home folder and elsewhere also have ACLs.



                          To see the ACLs within the home directory, use:



                          /bin/ls -le ~


                          You will likely see a rule like 0: group:everyone deny delete for the Music directory. As you noted you could override the problem with sudo. If you don't want to do that (or can't), you have other options, given that you're the owner of the file. You can strip off the offending entry from the Music directory's ACL, based on its index (0 in the example I gave above):



                          /bin/chmod -a# 0 Music


                          Or you can strip off all entries in the ACL:



                          /bin/chmod -N Music


                          Now you can move the directory around (subject to the regular POSIX permissions). If you want to put the ACL back after the move, you could use:



                          /bin/chmod +a "group:everyone deny delete" Music_tmp


                          And use /bin/ls -le again to confirm the ACL is as you want it. Check out the ACL examples in man chmod for more info. In particular, this intro is helpful:




                          Each file has one ACL, containing an ordered list of entries. Each entry refers to a user or group, and grants or denies a set of permissions. In cases where a user and a group exist with the same name, the user/group name can be prefixed with "user:" or "group:" in order to specify the type of name.








                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 18 mins ago









                          spinupspinup

                          31915




                          31915






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f234278%2fwhy-do-i-get-permission-denied-when-using-mv-althrough-directory-rights-are-corr%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              CARDNET

                              Boot-repair Failure: Unable to locate package grub-common:i386

                              濃尾地震