[筆記] 遞迴修改檔案權限 和 使用者列表

修改檔案權限

# 修改資料夾
find /path/to/base/dir -type d -print0 | xargs -0 chmod 755
# 修改檔案
find /path/to/base/dir -type f -print0 | xargs -0 chmod 644

取得使用者列表

cat /etc/passwd | awk 'BEGIN { FS=":" } { if($3>499) print $1 }' | sort

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *