How to change permissions for a folder and its subfolders/files in one step?

后端 未结 19 1798
情歌与酒
情歌与酒 2020-11-22 13:20

I would like to change permissions of a folder and all its sub folders and files in one step (command) in Linux.

I have already tried the below command but it works

19条回答
  •  花落未央
    2020-11-22 13:57

    If you want to set permissions on all files to a+r, and all directories to a+x, and do that recursively through the complete subdirectory tree, use:

    chmod -R a+rX *
    

    The X (that is capital X, not small x!) is ignored for files (unless they are executable for someone already) but is used for directories.

提交回复
热议问题