How to delete directory ~/Pictures?
My question is: what is protecting ~/Pictures from deletion, and how can I turn it off?
In macOS Catalina the Users > $USER > Pictures folder, aside from ACL's set on it, it is being protected by System Integrity Protection (SIP).
Even using sudo chmod -N Pictures
, while in the Home directory in Terminal, the directory can not be deleted unless done from macOS Recovery using Terminal without turning off SIP.
- Caution: This will remove the Pictures directory and everything in it!
Example:
rm -r "/Volumes/Macintosh HD - Data/Users/name/Pictures"
- Replacing
name
in/name/
with your short name, the name of your Home directory. - Replacing
Macintosh HD
as appropriate if you've modified the default name.
If you want to be able to delete if from a normal running occurrence of macOS Catalina, not macOS Recovery, then you will need to turn off SIP from macOS Recovery using Terminal from the Utilities menu.
csrutil disable
You could then immediately use:
csrutil enable --without fs
This way, except for the filesystem, the other protections offered by SIP are still in play.
Personally, I do not recommend doing this and would opt for deleting it from macOS Recovery without turning off SIP and then once booted back to normal mode macOS Catalina... I'd create the directory from Terminal while setting it hidden with SetFile
, applying ACL's to prevent any modifications while also removing all normal privileges (rwx
), all in the hope that Apple doesn't mess with it until the next upgrade.
That said, if your are the type that always shows all files including the hidden ones, then what's mentioned in the paragraph above is a moot point.
Notes:
To boot to macOS Recovery from a running occurrence, normal mode boot, of macOS, you can use the following compound command from Terminal:
sudo nvram "recovery-boot-mode=unused"; sleep 2; sudo reboot
Then before rebooting from macOS Recovery, in Terminal from the Utilities menu, run:
nvram -d recovery-boot-mode
The latter is not necessary in some versions of macOS, however, it doesn't hurt either way.