image link -chmod permission for user
I am trying to understand different permission for text file in linux , please refer the image i have attached. i want to ask two question.
1- when the text file only given read permission for user,i can move and rename file how it is possible if file has only read-only permission. ?
2- when file is only given write permission for user ,why can't i edit the file ?
21 Answer
Because it does not depend on the permissions of the file but on the permissions of the containing directory. As long as you have write-permission to the containing directory, you can move or rename the file.
You can't edit the file with any text-editor because the text-editor would need to load the file first which is not possible if you don't have read-permission for the file. You could still use other commands fo example
echo "some text" > fileto alter it's content though.