I created directory
test, created file
test, wrote 'Before' in this file.
Then I went
and used the command:
tar -cvzf ./test.tgz ./test
Then I entered the test dir again. Opened the
1.txt file again. Changed content to "After". I saved the file and changed chmod to read only by executing:
chmod -w ./1.txt
So for now my
1.txt is read only. Then I go up
and extract the
tar -xvzf ./test.tgz
Then I go again to test dir, do
and get "Before".
It is not logical that this happens, since the file was set to be read-only. Why does it happen?