Linux FAQ : 如何更改檔案 權限

 Linux FAQ : 如何更改檔案 權限

參考 : https://superuser.com/questions/648163/recursively-chown-all-files-that-are-owned-by-a-specific-user

更改檔案

#chmod permission_number file
#example :
chmod 775 abc.txt
#change file owner or group
#chown owner file
#example :
chown berry abc.txt
#chgrp group file
#example :
chgrp apple abc.txt
#chown owner.group file
#example :
chown berry.apple abc.txt

大量調整檔案

find . -type d -iname '???' -user old_user -exec chown -R new_user:new_group {} \\;

測試情境

find . -type d -iname 'zh_TW' -user tiptop -exec chown -R tiptop:tiptop {} \\;

簡介 : 找出目錄名稱為 zh_TW 用戶為 tiptop 執行更改此目錄全部檔案

用戶 tiptop 群組 tiptop

留言

這個網誌中的熱門文章

冒險者 1-4 part 2

部落衝突

Fantech EG1 立體聲入耳式電競耳機 開箱文 2018/07