3
When I execute the command
root@debian-hy:/var/www/sys# rm teste.txt
rm: cannot remove `teste.txt': Operation not permitted
Strange because I can edit the file and save, but when I close saw it generates a swap file, follows the file permissions:
-rwxrwxrwx 1 root root 6 May 21 08:31 teste.tx~
-rwxrwxrwx 1 root root 12K May 21 08:31 teste_tx.swn
-rwxrwxrwx 1 root root 12K May 21 08:31 teste_tx.swo
-rwxrwxrwx 1 root root 4.0K May 21 08:26 teste_tx.swp
-rwxrwxrwx 1 root root 12 May 21 08:31 teste.txt
-rwxrwxrwx 1 root root 0 May 21 08:26 .teste.txt.swp
-rwxrwxrwx 1 root root 0 May 21 08:26 .teste.txt.swx
If when you close the saw it generates a
.swp
, then you cannot edit the file. (can only read). What are the outputs of the commandslsattr teste.txt
andecho $UID $EUID
?– fonini
@fonini I didn’t even know this command lsattr, was researching this command I managed to solve the problem, thank you!
– SneepS NinjA