{"id":53,"date":"2011-06-15T04:40:00","date_gmt":"2011-06-14T23:10:00","guid":{"rendered":"http:\/\/asgaur.com\/wp\/?p=53"},"modified":"2011-06-15T04:40:00","modified_gmt":"2011-06-14T23:10:00","slug":"umask-and-how-it-works","status":"publish","type":"post","link":"http:\/\/www.asgaur.com\/wp\/umask-and-how-it-works\/","title":{"rendered":"umask and How It Works"},"content":{"rendered":"<p><!-- Adsense block #207 not displayed since it exceed the limit of 3 --><!-- Adsense block #208 not displayed since it exceed the limit of 3 --><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\"> The umask is a value that determines the default permission settings assigned when new files and directories are created.Each UNIX system has a default umask value; each user can change his or her own umask value (and usually does so at login time in a .cshrc, .login, or .profile file); each process can also examine or alter its umask value with the umask command.<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\">umask is an inherited feature. If a process sets a particular umask, its children will inherit the same umask value.Here&#8217;s how umask works. Numerically, it specifies which permissions are not granted by default when a file or directory is created. For example, a user&#8217;s umask is set to 027. The umask 027 is broken down into 0, 2, and 7. The 0 means that the user will have all permissions; the 2 means that group will not have write (2) permissions; the 7 means that other will not have execute (1), write (2), or read (4) permissions.<img fetchpriority=\"high\" decoding=\"async\" style=\"float: left;\" src=\"http:\/\/asgaur.com\/media\/umask027.JPG\" alt=\"\" width=\"569\" height=\"157\" \/><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\"><br \/><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\"><br \/><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\"><br \/><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\"><br \/><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\"><br \/><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\">Another way to think about umask is to subtract each of its digits from 7; the resulting digits are the permission set up for a file or directory that is created while that umask is in effect.<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\"><img decoding=\"async\" src=\"http:\/\/asgaur.com\/media\/umask777.JPG\" alt=\"\" \/><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\">In addition to being set numerically, a umask can also be set symbolically, with options similar to chmod&#8217;s symbolic syntax. For example<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\">umask u+rwx,g+rx,o-a &#8230;is the same as: umask 027<br \/>umask u+rw,g+r,o+r &#8230;is the same as: umask 133<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: arial,helvetica,sans-serif;\"><br \/><\/span><\/span><\/p>\n<div class=\"item_footer\">\n<p><small><a href=\"http:\/\/asgaur.com\/asgaur.php\/2011\/06\/15\/umask-and-how-it-works\" target=\"_blank\" rel=\"noopener\">Original post<\/a> blogged on <a href=\"http:\/\/b2evolution.net\/\" target=\"_blank\" rel=\"noopener\">b2evolution<\/a>.<\/small><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The umask is a value that determines the default permission settings assigned when new files and directories are created.Each UNIX system has a default umask value; each user can change his or her own umask value (and usually does so at login time in a .cshrc, .login, or .profile file); each process can also examine [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2,4,5,14],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-aix","category-hp-ux","category-linux","category-solaris"],"_links":{"self":[{"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":0,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}