Change all files and folders permissions of a directory to 644/755

后端 未结 8 968
孤街浪徒
孤街浪徒 2020-12-04 04:20

How would I change all files to 644 and all folders to 755 using chmod from the linux command prompt? (Terminal)

8条回答
  •  长情又很酷
    2020-12-04 05:10

    One approach could be using find:

    for directories

    find /desired_location -type d -print0 | xargs -0 chmod 0755
    

    for files

    find /desired_location -type f -print0 | xargs -0 chmod 0644
    

提交回复
热议问题