i used vim to create sa.sh in /home/guoyanzhang, when i used :wq, a warning appers as follows:
"sa.sh" E212: Can't open file for writing Press ENTER or type command to continue my system infomation is as follows: guoyanzhang@debian:~$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster guoyanzhang@debian:~$ whoami guoyanzhang guoyanzhang@debian:~$ ls -l /home/ total 4 dr-xr-xr-x 10 guoyanzhang guoyanzhang 4096 Aug 11 02:07 guoyanzhang guoyanzhang@debian:~$ touch sa.sh touch: cannot touch 'sa.sh': Permission denied
This indicates that the file was not created by user "guoyanzhang", or if it is a new file that you want to create, you have a problem with the permissions of your
home you can also simply test a
touch file.test, if you have the same problem it will confirm the problem.
ls -l /home to see the permissions of your
if the rights are incorrect you will need to use
sudo to change them.