一、恢复指定程序包所有文件的权限:
#!/bin/bash #Assume that you have mounted a correct orignal-system on /mnt read -p "Input packages' name: " pkg for i in $(rpm -ql $pkg) do chmod --reference=/mnt$i $i done
二、类似,恢复原始系统文件的权限
#!/bin/bash #Assume that you have mount a correct orignal-system on /mnt for i in $(find /mnt) do chmod --reference=/mnt$i $i done