You are here
Home > Redhat > Assign permission for file and folder in linux

Assign permission for file and folder in linux

To change 666 premission for files

 

chmod 666 filename

 

To change 777 permission for folder

chmod 777 foldername

 

To change 777 permission for folder,subfoler and files

chmod 777 -R foldername

 

To change all file to 644 permission in folders and subfolder

find ./ -type f -exec chmod 644 {} ;

 

To change all file to 644 permission in particular folders and not in subfolder

find -maxdepth 1 -type f -exec chmod 644 {} ;

 

To change 755 permission to folders and subfolders only

find ./ -type d -exec chmod 755 {} ;

 

To change 755 permission to all folders in particluar folders and not in subfolder

find -maxdepth 1 -type d -exec chmod 755 {} ;

 

php script

==========

<?php

system('find . -type f -exec chmod 644 {} ;');

system('find . -type d -exec chmod 755 {} ;');

?>

Leave a Reply

4 × two =

Top