Artificial intelligent assistant

Vim writes to file without having permissions $ ls sess.vim -lh -rw-r--r-- 1 root root 11K Feb 26 18:52 sess.vim I want this file to be readable for everyone and writable by no one (except by root). Thus I set its permissions to `644` and ownership to `root:root`. $ echo "text" >> sess.vim zsh: permission denied: sess.vim Seems fine. After some changes in vim I do `:w!` (force write) and the file is saved successfully. Now: $ ls sess.vim -lh -rw-r--r-- 1 MY_USERNAME users 11K Feb 26 19:06 sess.vim Wt.. **Why? How?**

Using `:w!` in vim is similar to the following:


echo 'test' > sess.vim.temp
mv sess.vim.temp sess.vim


The `mv` commands only cares about the directory permissions, the permissions of the file are not relevant. This is because you are modifying the directory, not writing to the file. To accomplish your goal, you will also need to adjust the permissions of the directory the file resides in.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ecdfd2056fdd31fbcf173881027d2a4c