terminalcommand-promptchmod

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


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


Solution

  • 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