Skip to main content
  1. Posts/

macOS Operation Not Permitted?

·200 words·1 min·
Table of Contents

Some permission related issue on macOS.

File lock issue

For some time, when I open kitty terminal on macOS, I always see the following warning message:

zsh: locking failed for /Users/jdhao/.histfile: operation not permitted: reading anyway

This may be because the HOME directory is locked (for me, this is the case). To unlock the directory, open the Finder and click the $HOME directory, press Command + i to get the file info. Under the General section, make sure that the Locked button is unchecked.

To change the file lock state on the command line, use chflag:

chflag -R nouchg /path/to/directory

After restarting the terminal emulator, the issue should be gone.

Operation permission issue

Another issue I often get is that when I use ls or rm on some files, I often get a message like the following:

ls ~/Library/Messages ls: Messages: Operation not permitted

This is due to the disk access issue. Open macOS Security & Privacy settings and go to Privacy tab. Give your terminal emulator Full Disk Access.

Restart your terminal and the issue will be fixed.



How to Extract PDF file on macOS
·147 words·1 min
PATH Variable Changed inside Tmux on macOS?
·424 words·2 mins
Tmux: Open Terminal Failed in Kitty Terminal
··258 words·2 mins