Who Knows How To Use sudo?

I just replaced my large, noisy external HDD RAID with a smaller, quieter SSD one. So far, so good. I had copied over the User Movies, Music & Pictures folders to the external and then, using the root user, deleted the originals and replaced them with Sym Links. I have been using this setup for many years going back to my Mac Pros.

So now there is a bug in Sonoma with the root user Finder crashing. I believe this has been fixed in the 14.2 beta but I don’t really want to install a beta operating system on my main Mac. I believe this can be accomplished using the sudo command. I used to use Terminal quite a lot back in the day but it’s just confusing now. Can anyone help me with this? Thanks in advance…

Richard, I hope this is what you are after.

sudo ln -s /Volumes/yourexternaldrivename/Pictures /Users/yourusername/Desktop
This should work and put an icon for the Pictures folder from the external onto your desktop.
You should be logged in as an admin user and will be asked for your account password for the command to run.
Only admin group users can use sudo.

Thanks, that is very helpful but I also need to be able to delete the empty Movies, Music & Pictures folders from my Users folder. These were generated automatically when I deleted the Sym Links to my old drive.

Richard, If you really want to do this then:
sudo rm -r /Users/yourusername/Movies

And to recreate if you want it back:
sudo mkdir /Users/yourusername/Movies

Then, These commands set the ownership and permissions back to the originals.
sudo chown yourusername /Users/yourusername/Movies
sudo chmod 700 /Users/yourusername/Movies

Some software may expect these directories to exist.

Excellent, thanks. I appreciate it. I’ll give it a go tomorrow.

Ok, an update. I have to thank you so much @JimWoz for your help. Things have gone perfectly with the Movies & Music folders however the command won’t let me delete the Pictures folder for some reason. The folder is empty & the alias for the Pictures folder on my external drive is on the Desktop.

Any suggestions?

There may be extended attribute file permissions stopping this.
Try sudo chmod -N /Users/yourusername/Pictures and then
the delete command.

Ok. Thanks. I’ll give it a go.

No go unfortunately. It’s still coming up with “Operation not permitted”.

Richard,
First try this:
cd /Users/yourusername/Pictures
then
ls -ale.
Are there any invisible files showing up inside Pictures that have a . (dot) as first character ?
Are there any entries with a + or @ character at the end of the permissions list ?
And, are there any extra lines like : 0: group:everyone deny delete ? - This is an extended attribute and should have been removed by the chmod -N command.

Screenshot 2023-11-30 at 9.33.51 pm

Here is a screenshot of the Terminal window after those last two commands. There are no visible files in the Pictures folder,

The extended attribute for everyone group is doing you in here Richard.
Will sleep on this.
All users are a member of the Everyone Group.

Ok. I wonder how that occurred? Looks like we’re all on a bit of a learning curve. Anyway, thanks again for your help. I really appreciate it.

OK.
Hopefully this works Richard. It will remove the Access Control Entry.
Not sure if it will be allowed if you have System Integrity Protection on (the default)
It works with SIP disabled though. - I’ve checked.
sudo chmod -a “everyone deny delete” /Users/yourusername/Pictures
the -a deletes the ACE. (Use +a to add it back.)
Then run the rm/delete command.

To disable SIP go here. Then re enable again after doing the deletion.

Not sure why but I have an ACE on Movies and Music folders too !
I disabled SIP on my machine so long ago I can’t remember why. - Maybe it was to use TotalFinder.

Edit:
Another idea that didn’t work. - Add a folder in your user directory called Unused Folders say.
Then move Pictures to there. - But Guess what. It fails.

Thanks @ JimWoz. I won’t get a chance to have another look at this until at least tomorrow but I’ll let you know how I go.

Ok, an update. SUCCESS!!! WooHoo. I’m back to “normal” now. Can setup my new backups & stuff.

A big thanks again @JimWoz. I really appreciate you going out of your way to help. I couldn’t have done it without you. Shows the value of this old forum…

1 Like

:blush: :+1: