on my mac os system (v. 10.9.3) I wanted to uninstall my zsh so first of all I executed the uninstall script in zsh. This failed so I wanted to delete the affected files by my own and am stuck here.

Everytime i try to rm the .oh-my-zsh directory or the .zsh_history (or any other file) file i get :

rm: /Users/username/.oh-my-zsh: Operation not permitted

I already tried to check for osx flags, but no flags are set (with ls -lO).

Also I tried to give the directory full permission (755) but the deletion also fails.

Does anybody know how to deal with this? Thanks a lot.


see answer, was able to resolve this on my own.

  • Try running fuser .oh-my-zsh to see if the file is opened by some process. I'm not sure if OSX has the fuser command though.
    – drkblog
    May 19, 2014 at 15:39
  • OSX hat his command but it says its not opened by others..
    – maksim
    May 19, 2014 at 16:20
  • Which shell are you using to do this?
    – drkblog
    May 19, 2014 at 16:23
  • I reverted to bash (with chsh -s /bin/bash and source /etc/profile)
    – maksim
    May 19, 2014 at 16:24
  • Have you rebooted after chsh? Otherwise zsh will be running probably multiple times in the background. (I wonder, however, why this is preventing you from deleting these files -- at least Linux does not care about removing opened files, I thought OSX will behave similar.)
    – mpy
    May 19, 2014 at 16:48

1 Answer 1


Ok, i was able to resolve this on my own..

Somehow I had the nouchg flag on my home directory. So not the files inside had this flag but the Users/username directory.

So doing this:

sudo chflags nouchg username/

i was able to delete the files.

Thanks for your input.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.