{"id":13972,"date":"2026-04-15T01:01:00","date_gmt":"2026-04-15T05:01:00","guid":{"rendered":"https:\/\/www.both.org\/?p=13972"},"modified":"2026-04-13T06:10:30","modified_gmt":"2026-04-13T10:10:30","slug":"demystifying-file-permissions-in-linux","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=13972","title":{"rendered":"Demystifying File Permissions in Linux"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"13972\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">1    <\/span>\r\n<\/div><\/div>\n<p>The first Linux CD I bought in the mid-1990s was Red Hat 5.0. It came with a book that claimed you could learn Linux in twenty-four hours\u2014or maybe it was a week\u2014but in any case, that seemed unrealistic. Before diving into the Linux learning curve, I had some experience with MS-DOS and, prior to that, with Apple&#8217;s ProDos. I found working from the command line intimidating and had little interest in it. In fact, I dismissed my initial experience with Linux because I thought it was simply a rehash of MS-DOS, which I didn\u2019t fully understand or appreciate at the time. Overall, I had limited experience with the command line on any operating system.<\/p>\n\n\n\n<p>Almost thirty years later, I wouldn&#8217;t consider myself an expert, but I am familiar with the command line and understand the importance and power of the Linux file system. One of Linux&#8217;s strengths is its permission-oriented nature, which is a key reason it is often considered superior to other systems, such as Microsoft Windows. <span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">In my early days using Linux, I didn&#8217;t understand <span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">or appreciate the importance of users and groups, nor the significance of the&nbsp;<strong>root<\/strong>&nbsp;user and&nbsp;<\/span><\/span>other system users. <\/p>\n\n\n\n<p>File permissions in Linux are crucial for maintaining system security and controlling access to files and directories. Each file and directory has associated permissions that determine who can read, write, or execute it. These permissions are divided into three categories: owner, group, and others. The owner typically has full control over their files, while group members may have restricted access based on the permissions set.<\/p>\n\n\n\n<p>File permissions control who can read, write, and execute files. Each file has three permission types:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Read (r)<\/strong> \u2014 view file contents<\/li>\n\n\n\n<li><strong>Write (w)<\/strong> \u2014 modify or delete the file<\/li>\n\n\n\n<li><strong>Execute (x)<\/strong> \u2014 run the file as a program<\/li>\n<\/ul>\n\n\n\n<p>These apply to three categories:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Owner (u)<\/strong> \u2014 the file&#8217;s creator<\/li>\n\n\n\n<li><strong>Group (g)<\/strong> \u2014 users in the file&#8217;s group<\/li>\n\n\n\n<li><strong>Others (o)<\/strong> \u2014 everyone else<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Reading Permission Notation<\/h4>\n\n\n\n<p>When you run <code>ls -l<\/code>, you see something like: <code>-rw-r--r--<\/code><\/p>\n\n\n\n<p>Breaking it down:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First character: file type (<code>-<\/code> = regular file, <code>d<\/code> = directory)<\/li>\n\n\n\n<li>Next 3 characters: owner permissions (<code>rw-<\/code> = read &amp; write)<\/li>\n\n\n\n<li>Next 3 characters: group permissions (<code>r--<\/code> = read only)<\/li>\n\n\n\n<li>Last 3 characters: others permissions (<code>r--<\/code> = read only)<\/li>\n<\/ul>\n\n\n<p>The <code>chmod<\/code> command, short for &#8220;change mode,&#8221; is a Linux command that changes the file system permissions of files and directories. Using chmod, users can set permissions for three types of users: the file&#8217;s owner, the file&#8217;s group, and others. This command allows for fine-tuning of access rights, enhancing security and collaboration within a multi-user environment.<\/p>\n\n\n<p><strong>Symbolic method<\/strong> (easier to remember):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod u+x file.txt        # Add execute for owner\nchmod g-w file.txt        # Remove write from group\nchmod o=r file.txt        # Set others to read-only\nchmod a+r file.txt        # Add read for all<\/code><\/pre>\n\n\n\n<p><strong>Numeric method<\/strong> (r=4, w=2, x=1):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 755 file.txt # Owner: rwx (7), Group: r-x (5), Others: r-x (5)\nchmod 644 file.txt # Owner: rw- (6), Group: r-- (4), Others: r-- (4)\nchmod 700 file.txt # Owner: rwx (7), Group: --- (0), Others: --- (0)<\/code><\/pre>\n\n\n\n<p><strong>Common examples:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Permission<\/th><th>Numeric<\/th><th>Use Case<\/th><\/tr><\/thead><tbody><tr><td><code>rwxr-xr-x<\/code><\/td><td>755<\/td><td>Executable scripts\/directories<\/td><\/tr><tr><td><code>rw-r--r--<\/code><\/td><td>644<\/td><td>Regular files<\/td><\/tr><tr><td><code>rwx------<\/code><\/td><td>700<\/td><td>Private files<\/td><\/tr><tr><td><code>rwxrwxrwx<\/code><\/td><td>777<\/td><td>Everyone can do anything (risky!)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In conclusion, understanding file permissions in Linux is essential for anyone looking to harness the full power of this operating system. Mastering how to manage and apply permissions not only enhances your ability to secure your files but also ensures that you can collaborate effectively in multi-user environments. As you become more comfortable with the command line and the structure of Linux, you&#8217;ll appreciate how these permissions safeguard your data and enhance the overall stability of the system. Whether you&#8217;re a beginner or have some experience under your belt, investing time in learning about file permissions will undoubtedly pay off in your journey with Linux. Remember, with great power comes great responsibility; knowing how to set and manage permissions is a fundamental skill that can prevent data loss and maintain system security.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1 The first Linux CD I bought in the mid-1990s was Red Hat 5.0. It came with a<\/p>\n","protected":false},"author":32,"featured_media":12702,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[407,503,75],"tags":[950,957,951,261],"class_list":["post-13972","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-file-management","category-linux-101","category-security","tag-files","tag-linux-101","tag-permissions","tag-security"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/13972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13972"}],"version-history":[{"count":2,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/13972\/revisions"}],"predecessor-version":[{"id":14027,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/13972\/revisions\/14027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/12702"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}