linux 同时写文件格式,Linux一次性修改电脑的文件的为读写格式

第一步:

编辑一下文本,大家可以对脚本按照自己的要求更改:

#!/bin/bash

#chmod all text file to read and write;

find ~ -name "*.doc*" -exec chmod 644 -R {} \;

find ~ -name "*.xls*" -exec chmod 644 -R {} \;

find ~ -name "*.ppt*" -exec chmod 644 -R {} \;

find ~ -name "*.pdf" -exec chmod 644 -R {} \;

find ~ -name "*.txt" -exec chmod 644 -R {} \;

find ~ -name "*.hlp" -exec chmod 644 -R {} \;

find ~ -name "*.wps" -exec chmod 644 -R {} \;

find ~ -name "*.rtf" -exec chmod 644 -R {} \;

find ~ -name "*.htm*" -exec chmod 644 -R {} \;

#chmod all picture to read and wirte;

find ~ -name "*.png" -exec chmod 644 -R {} \;

find ~ -name "*.jpg" -exec chmod 644 -R {} \;

find ~ -name "*.bmp" -exec chmod 644 -R {} \;

find ~ -name "*.jpeg" -exec chmod 644 -R {} \;

find ~ -name "*.gif" -exec chmod 644 -R {} \;

find ~ -name "*.dwg" -exec chmod 644 -R {} \;

find ~ -name "*.pic" -exec chmod 644 -R {} \;

find ~ -name "*.tif" -exec chmod 644 -R {} \;

#chmod all compress to read&write:

find ~ -name "*.rar" -exec chmod 644 -R {} \;

find ~ -name "*.zip" -exec chmod 644 -R {} \;

find ~ -name "*.arj" -exec chmod 644 -R {} \;

find ~ -name "*.gz" -exec chmod 644 -R {} \;

find ~ -name "*.bz*" -exec chmod 644 -R {} \;

#chmod all video to read&write:

find ~ -name "*.avi" -exec chmod 644 -R {} \;

find ~ -name "*.mp3" -exec chmod 644 -R {} \;

find ~ -name "*.wav" -exec chmod 644 -R {} \;

find ~ -name "*.mp4" -exec chmod 644 -R {} \;

find ~ -name "*.swf" -exec chmod 644 -R {} \;

#chmod all source code to R&W;

find ~ -name "*.h" -exec chmod 644 -R {} \;

find ~ -name "*.c" -exec chmod 644 -R {} \;

find ~ -name "*.java" -exec chmod 644 -R {} \;

#到此,脚本结束

第二步:保存脚本文件为chmymod

第三步:修改脚本的权限:chmod 644 chmymod

并将脚本移动到/bin下!

到此,就结束了。大家只要在命令行输入chmymod就可以看到效果了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值