[Ubuntu/Unix] รีเซ็ตค่า Permission ให้ File กับ Folder

ถ้าเผลอไป chmod 777 -R /dir เข้าสักโฟเดอร์ล่ะ... จะคืนค่ากลับมายังไง
เออนั่นสิ

พี่กู กับพี่แต๊ก มีคำตอบให้ครับ
https://superuser.com/questions/91935/how-to-chmod-755-all-directories-but-no-file-recursively

โฟเดอร์
find /path/to/base/dir -type d -exec chmod 755 {} +

ไฟล์
find /path/to/base/dir -type f -exec chmod 644 {} +

เสร็จแหล่ววว แบร่


Comments