开发者

Changing the file permissions of multiple files through Unix terminal

开发者 https://www.devze.com 2023-03-24 07:52 出处:网络
Hi I have about a 100 files in a folder and I want to change the file permis开发者_StackOverflowsions to read write and execute for each file in this folder.

Hi I have about a 100 files in a folder and I want to change the file permis开发者_StackOverflowsions to read write and execute for each file in this folder.

I know how to change the file permissions for a single file i.e. chmod a+rwx foo.txt but not for a group of files. Please help me out

Thank you!

GT


you can use wildcards, like

chmod a+rwx *.txt

or

find <directory> -type f -exec chmod a+rwx {} \;

the last command will find all files and exec the chmod per each file.

however, having a+rwx is not recommended at all

0

精彩评论

暂无评论...
验证码 换一张
取 消