changing permissions of files in a directory recursively

前端 未结 4 409
庸人自扰
庸人自扰 2021-02-03 15:41

I am trying to change the permissions of a files present in a directory and subdirectories using the below command and running into below error..can anyone help?



        
相关标签:
4条回答
  • 2021-02-03 15:59

    It looks to me like you don't have permission to change NonVolatileStore.cpp.

    Are you aware of chmod's -R switch that recursively changes permissions?

    0 讨论(0)
  • 2021-02-03 15:59

    It could be that you simply don't own that file. Run an ls -l on it to see full permissions and who the owner is.

    It could also be the filesystem is read only.

    0 讨论(0)
  • 2021-02-03 16:04

    if you have the root privilege, try:

    sudo find . -type f -exec chmod 644 {} \;  
    
    0 讨论(0)
  • 2021-02-03 16:25

    you can run the following command:

     #chown -R directory_path
    

    But it will change the permissions of directories also.

    For only files, you can run.

     #find directory_path -type f -exec chmod 644 {} \;
    

    It also looks like you dont have enough permissions. try

     #sudo find directory_path -type f -exec chmod 644 {} \;
    

    or run the command as root user.

    0 讨论(0)
提交回复
热议问题