2

The directory ~/Movies:

16:43 $ tree /Users/ibodding/Movies
/Users/ibodding/Movies
└── TV
    ├── Media.localized
    └── TV\ Library.tvlibrary
        ├── Library\ Preferences.tvdb
        └── Library.tvdb

My .bash_profile deletes this every time on load, but it pops back up just as quickly.

I don't use any Apple applications aside from Finder and System Preferences. How can I prevent MacOS from recreating this directory?

4
  • Which version of macOS are you using? Also, why bother with the directory, it doesn‘t use a significant amount of space. – nohillside May 15 at 16:08
  • Are you watching videos on another Apple device that's signed into your AppleID? phone, iPad, AppleTV box, etc. – benwiggy May 15 at 16:09
  • @nohillside - 11.3.1, being able to control the files within my own home directory seems like an obvious ask – Ingmar Boddington May 17 at 14:53
  • @benwiggy - No, I run two Macbooks (one for work, and one for personal projects) - on both I only use Finder and System Preferences Apple applications. – Ingmar Boddington May 17 at 14:55
7

How can I prevent MacOS from recreating this directory?

If you do not mind having a hidden file, not folder, named Movies in the Home folder, then the compound command below, In Terminal, will do the following:

  • Delete the Movies folder, including anything in it.
  • Create a file named: Movies
  • Sets an ACL of everyone deny delete on it.
  • Remove all permissions for everyone to it.
  • Hides the Movies file.
rm -R Movies; touch Movies; chmod +a 'everyone deny delete' Movies; chmod 0000 Movies; chflags hidden Movies 

This effectively stops anyone, including the system, from creating a folder name Movies in the Home folder until the ACL is removed from the file Movies and the file is deleted.

For example, after running the above compound command, opening the TV application will not automatically recreate the a folder name Movies in the Home folder.


Notes:

Assumes the pwd in Terminal is your Home directory when running the compound command in Terminal.

The compound command used above was tested in Terminal under macOS Catalina and macOS Big Sur with Language & Region settings in System Preferences set to English (US) — Primary, from an Admin account, and worked for me without issue1.

  • 1 Assumes necessary and appropriate setting in System Preferences > Security & Privacy > Privacy have been set/addressed as needed.

To remove the Movies file from Terminal afterwards:

chmod -N Movies
rm Movies
override ---------  $USER/staff hidden for Movies? 

Type Y when prompted and press enter.

1
  • Thanks for the detailed response. With this solution I will still see the hidden file in terminal (where I do not want anything hidden from me). But marking as answer as this looks to be the best solution available. – Ingmar Boddington May 17 at 14:52

You must log in to answer this question.

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