How Does umask Really Work? Default Permissions Decoded
Автор: Linux2AI
Загружено: 2025-08-16
Просмотров: 11
Описание:
Curious how umask sets default permissions in Linux? Let's decode it in under 60 seconds!
What is umask?
It's a creation mask — not granting permissions, but removing them from the system defaults (typically 666 for files and 777 for directories). (Ask Ubuntu, Red Hat Guide)
How does it work?
Permission bits set in the umask are cleared from the default using a bitwise AND with the complement of the mask — not a simple subtraction. In other words:
final_permissions = default_permissions & (~umask)
Quick examples with umask 022:
Files: 666 & ~022 = 644 → rw-r--r--
Directories: 777 & ~022 = 755 → rwxr-xr-x
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: