Glam Prestige Journal

Bright entertainment trends with youth appeal.

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 ?

2

1 Answer

  1. 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.

  2. 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" > file to alter it's content though.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy