12

Is there anyway to get Music out of my way in my home directory? Either deleting it, or moving it to someplace else.

Now, I know that this question has been asked before (I've read this one and this one too), so I know that some more details are needed or I'll get back bogus answers... So: what I want is to rename or remove the actual folder, hopefully with any magical stuff that the OS is doing with it (like scanning it for changes, or worse: add meta-data files).

Symbolic links are unrelated here, since I want to move the actual directory to a place I don't really care about, I don't want to create some other name for it. I also don't care what's visible in the Finder -- so flipping some hidden bit that makes it not show up there won't do me any good. This is making it a very different issue from the ones in those other questions.

(The complete story is that I have recently started using a Mac, and I need to wire it into the network of file syncing that I do across many machines (using unison). Naturally, I have music in a music directory, which collides with OSX's Music thing, so I need to get it out of my way. That's why I don't care how it's shown in the Finder or if I'm losing some marvelous iTunes features. (I will most likely not even notice it if both Finder and iTunes disappear from this machine.))

5 Answers 5

7

Do you have any indication that the OS will mind if you just rm -rf Music?

As far as I know, iTunes is the only app that uses that directory (at least on my machine, there seems to be nothing else in it).

So if you don't ever launch iTunes again, that directory should never reappear. If you want to guard against accidentally opening iTunes, you can move its library to a different location before removing the directory.

3
  • 4
    ~/Music/ is also used by Logic, GarageBand, and Live, and it might get recreated when you upgrade OS X. But I'd also just try changing the location of the iTunes Media directory and running sudo rm -r ~/Music.
    – Lri
    Aug 29, 2013 at 11:36
  • Good point, I never used any of those apps.
    – mfilej
    Aug 29, 2013 at 14:40
  • 1
    forehead slap... I've tried so hard to rename and move it (which doesn't work) that I didn't even think that just removing it would work. (And yes, I'm sure that itunes and other junkware will try to use it...) Aug 29, 2013 at 17:34
4

It won't work. The system keeps re-creating a Music folder in the Home directory.

  1. If you run them, then yes, iTunes and many other applications use the ~/Music directory.

  2. Moving the iTunes Media folder won't get you out from under that. iTunes creates many other items in the ~/Music directory in addition to the Media folder, and those other items will not get moved from ~/Music when the Media folder does. And given the chance, (i.e., running it), iTunes will create those items, re-create them after you remove them, and re-create them again and again.

  3. As far as I can tell, and I've worked pretty hard on it, you're stuck with something called "Music" or "music" going to be in your Home directory. I say "something", because it can also be a file. It doesn't sound like this approach is a viable solution for you, but it may be for others with almost exactly the same requirements (but not exactly the same). It worked for me. Though not a solution, hopefully the preceding information is informative. I believe it to be incontrovertible.

  4. After deleting the offending folder, I created two empty, zero byte files and saved them in the Home directory. I named one "music" and the other ".music" with no file extension in either case. Their presence blocks the system from creating a folder in that location with the name "Music". I set the immutable flag (chflags uchg ~/music) on both, I manually hid the visible one, and I roundly revoked the "write" permission from each. One would think that would do the trick, but when the system cannot save its folder there because it cannot over-write the files, it tries to change the permissions back and restore its power to write. To overcome this I made root the owner of the two files. That about did it. No more Music folder.

Note to Editor: Please do not alter the syntax of "something called 'Music' or 'music' going to be in your Home directory" above. It may sound awkward, but it is extremely precisely worded. I'd rather not post at all if the phrase is not allowed to stand ver batim. Thanks.

3
  • A big sigh to all of this... Having itunes write its own stuff in my music forlder would have been pretty obnoxious. (Obligatory semi-flame follows) Luckily for me, I've moved on from using that OS, and I'm now back to a semi-saner ground. Well, at least my ~/music is my ~/music, and my current OS doesn't have any opinion on that matter. Jun 2, 2014 at 17:54
  • I'm sorry for bringing up an old post; your question was in the feed on the right frame. I mistakenly thought that meant it was recent. Maybe it meant it was topically similar to what I was reading at the time. Also, I don't know how to send users messages directly, or I'd do that now. I don't think I'm supposed to write anything this informal here as an "answer".
    – Parker
    Jun 4, 2014 at 8:24
  • Well, the value of having answers goes beyond my personal needs, of course. (And I also might need to use a Mac again in the future, and will surely deal with this again then.) Jun 4, 2014 at 12:25
1

I do not know about the other answers, but checking the ACL (ls -le) gave me this:

0: group:everyone deny delete

so I chmod -N'd (or chmod -a# 0) the folders to remove the ACL and I successfully deleted Music like a piece of cake.

I have deleted Downloads, Music, Movies, Desktop (maybe also Documents), Public using this method, but I have not been able to delete Pictures for some reason.

Also, if you would like to also make your files "undeletable", just add the ACL:

chmod +a 'group:everyone deny delete'
1
  • For me this works for Music, but sudo chmod -N Desktop results in chmod: Failed to clear ACL on file Desktop: Operation not permitted. The same applies to the files inside of the Pictures folder.
    – Paul
    Dec 27, 2022 at 18:25
-1

From: Remove Movies Home folder at Official Apple Support Communities

It is set to not delete because it may be expected by some programs. If you really think it is necessary to delete the folder, you could remove it in the Terminal with

sudo rm -r ~/Movies

Be careful and good luck. If you mess up typing the command you could delete something you didn't want to. sudo will ask for your password, but won't actually show anything on screen when you type it. rm is remove and -r tells it to work through any subfolders. ~/ is your home directory.

1
  • This doesn't say anything that wasn't covered by the already accepted answer, in better detail.
    – Tetsujin
    Aug 19, 2016 at 8:37
-2

If you just want to hide it from Finder, open your Console and execute the following command line in your Home directory:

chflags hidden ./Music

The directory is still there, however, Finder will not display it as it is marked hidden.

If you change your mind, then:

chflags nohidden ./Music

For complete chflags documentation, type:

man chflags.

1
  • 1
    "rename or remove the actual folder" Sep 10, 2019 at 8:38

You must log in to answer this question.

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