Linux: Chmod recursively

Linux: Chmod recursively

Asked on October 23, 2018 in Linux.
Add Comment


  • 5 Answer(s)

    Change all the persmissions at the same time :

    chmod -R +xr
    
    Answered on October 23, 2018.
    Add Comment

    To make everything writable by the owner, read/execute by the group, and world executable:

    chmod -R 0755
    
    

    To make everything wide open:

    chmod -R 0777
    
    
    Answered on October 23, 2018.
    Add Comment
     

    In order to get both read access and execute access,to list a directory.In case to execute access , then you can find out the names of entries in the directory, but no other information (not even types, so you don’t know which of the entries are subdirectories).

    find . -type d -exec chmod +rx {} \;
    

     

    Answered on October 23, 2018.
    Add Comment
    1. Use chmod -R 755 /opt/lampp/htdocs if you want to change permissions of all files and directories at once.
    2. Use find /opt/lampp/htdocs -type d -exec chmod 755 {} \; if the number of files you are using is very large. …
    3. Use chmod 755 $(find /path/to/base/dir -type d) otherwise.
    4. Better to use the first one in any situation.

    To make everything writable by the owner, read/execute by the group, and world executable:

    1
    chmod -R 0755

    To make everything wide open:

    1
    chmod -R 0777
    Answered on January 16, 2019.
    Add Comment

    The correct recursive command is:

    sudo chmod 755 -R /opt/lampp/htdocs
    

    -R: change every sub folder including the current folder

    Answered on January 16, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.