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.
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
override --------- $USER/staff hidden for Movies?
Type Y when prompted and press enter.