How to chmod a folder, its subfolders and files

Home forums Unix and Linux How to chmod a folder, its subfolders and files

This topic contains 0 replies, has 1 voice, and was last updated by  Hemant Sharma 1 month, 2 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2218

    Hemant Sharma
    Moderator

    chmod -R 755 can change the permissions recursively but it will change same permissions for everything , folders,subfolders and files.

    To selectively change permission , use find command to get the directories or files and then change mode.

    find directories and change mode to 755

    $find /home/james -type d -exec chmod 755 {} \;

    find directories and chand mode to 755

    $find /home/james -type f -exec chmod 644 {} \;

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.