{"id":18404,"date":"2023-11-30T08:58:26","date_gmt":"2023-11-30T08:58:26","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=18404"},"modified":"2023-11-30T08:58:26","modified_gmt":"2023-11-30T08:58:26","slug":"chmod-command-linux","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/","title":{"rendered":"chmod Command Linux"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg\" alt=\"\" \/><br \/>\nIn the world of Linux, one of the fundamental aspects of file and directory management is controlling access through permissions. The chmod command, which stands for &quot;change mode,&quot; is a powerful tool that allows users to modify the permissions of files and directories. This command plays a crucial role in ensuring the security and integrity of a Linux system.<\/p>\n<h2>Basic Concept of File Permissions<\/h2>\n<p>Before delving into the chmod command, it&#8217;s essential to understand the basic concept of file permissions in Linux. Each file and directory in a Linux system has associated permissions that determine who can read, write, or execute that file or directory.<\/p>\n<h3>Types of File Permissions<\/h3>\n<p>There are three main types of permissions:<\/p>\n<ul>\n<li><strong>Read (r):<\/strong> Allows users to view the contents of a file or list the contents of a directory.<\/li>\n<li><strong>Write (w):<\/strong> Permits users to modify the contents of a file or create, delete, and rename files within a directory.<\/li>\n<li><strong>Execute (x):<\/strong> Grants users the ability to execute a file or access the contents of a directory.<\/li>\n<\/ul>\n<p>These permissions are assigned to three categories of users:<\/p>\n<ul>\n<li><strong>Owner:<\/strong> The user who owns the file or directory.<\/li>\n<li><strong>Group:<\/strong> A collection of users who share a common set of permissions.<\/li>\n<li><strong>Others:<\/strong> Everyone else who does not fall into the owner or group categories.<\/li>\n<\/ul>\n<h2>The chmod Command Syntax<\/h2>\n<p>The chmod command follows a specific syntax to change the permissions of a file or directory. The basic syntax is as follows:<\/p>\n<pre><code>chmod [options] permissions file(s)<\/code><\/pre>\n<p>Here, [options] can include various modifiers, and permissions indicate the new permissions to be set. The file(s) argument specifies the target file or directory.<\/p>\n<p><strong>Numeric Mode and Symbolic Mode<\/strong><br \/>\nThe chmod command offers two primary modes for specifying permissions: numeric mode and symbolic mode.<\/p>\n<p><strong>Numeric Mode:<\/strong><br \/>\nNumeric mode involves using a three-digit octal (base-8) number to represent the permissions for the owner, group, and others. Each digit is a sum of the corresponding permission values:<\/p>\n<p>For example, to set read and write permissions for the owner, read-only permissions for the group, and no permissions for others, the numeric mode would be 640:<\/p>\n<pre><code>chmod 640 filename<\/code><\/pre>\n<p><strong>Symbolic Mode:<\/strong><br \/>\nSymbolic mode allows users to express permissions symbolically using letters: u for user\/owner, g for group, o for others, and a for all. The symbols + and &#8211; are used to add or remove permissions, and = sets the permissions explicitly.<\/p>\n<p>For example, to give the owner read and write permissions and remove execute permissions for others:<\/p>\n<pre><code>chmod u=rw,go=r filename<\/code><\/pre>\n<h3>Practical Examples of chmod Command Linux<\/h3>\n<p>Here are some of the Practical examples of chmod Command Linux:<br \/>\n<strong>1. Granting Execute Permission to a Script<\/strong><\/p>\n<pre><code>chmod +x script.sh<\/code><\/pre>\n<p>This command adds execute permissions to the script script.sh, allowing it to be executed.<\/p>\n<p><strong>2. Restricting Access to a File<\/strong><\/p>\n<pre><code>chmod 600 sensitive_file.txt<\/code><\/pre>\n<p>Here, the owner has read and write permissions, while the group and others have no permissions, ensuring maximum privacy.<\/p>\n<p><strong>3. Making a Script Accessible to Everyone<\/strong><\/p>\n<pre><code>chmod a+x my_script.sh<\/code><\/pre>\n<p>This command grants execute permissions to all users (owner, group, and others) for the script my_script.sh.<\/p>\n<p><strong>Conclusion<\/strong><br \/>\nThe chmod command is a crucial tool for managing file and directory permissions in Linux. Understanding how to use it is essential for maintaining the security and integrity of a system. Whether you are a system administrator or an everyday Linux user, mastering chmod is a valuable skill in navigating the rich and flexible world of Linux file permissions.<\/p>\n<h2>Frequently Asked Questions Related chmod Command in Linux<\/h2>\n<p>FAQs Related to chmod Command in Linux:<\/p>\n<p><strong>1. What does the chmod command stand for?<\/strong><br \/>\nThe chmod command stands for &quot;change mode&quot; in Linux. It is used to modify the permissions of files and directories.<\/p>\n<p><strong>2. How are file permissions represented in Linux?<\/strong><br \/>\nFile permissions are represented by three sets of characters: r for read, w for write, and x for execute. These permissions are assigned to three categories: owner, group, and others.<\/p>\n<p><strong>3. What are the three types of permissions in Linux?<\/strong><br \/>\nThe three types of permissions in Linux are read (r), write (w), and execute (x).<\/p>\n<p><strong>4. What is the numeric mode in the chmod command?<\/strong><br \/>\nThe numeric mode is a way of representing permissions using a three-digit octal number. Each digit corresponds to the permission value for owner, group, and others, respectively.<\/p>\n<p><strong>5. How do I grant execute permissions to a file using chmod?<\/strong><br \/>\nUse the +x option with chmod to grant execute permissions. For example: chmod +x filename.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the world of Linux, one of the fundamental aspects of file and directory management is controlling access through permissions. The chmod command, which stands for &quot;change mode,&quot; is a powerful tool that allows users to modify the permissions of files and directories. This command plays a crucial role in ensuring the security and integrity [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[230],"tags":[],"class_list":["post-18404","post","type-post","status-publish","format-standard","hentry","category-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>chmod Command Linux<\/title>\n<meta name=\"description\" content=\"The chmod command, which stands for \u201cchange mode,\u201d is a powerful tool that allows users to modify the permissions of files and directories.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"chmod Command Linux\" \/>\n<meta property=\"og:description\" content=\"The chmod command, which stands for \u201cchange mode,\u201d is a powerful tool that allows users to modify the permissions of files and directories.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-30T08:58:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg\" \/>\n<meta name=\"author\" content=\"Prepbytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prepbytes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/\"},\"author\":{\"name\":\"Prepbytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\"},\"headline\":\"chmod Command Linux\",\"datePublished\":\"2023-11-30T08:58:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/\"},\"wordCount\":719,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg\",\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/\",\"name\":\"chmod Command Linux\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg\",\"datePublished\":\"2023-11-30T08:58:26+00:00\",\"description\":\"The chmod command, which stands for \u201cchange mode,\u201d is a powerful tool that allows users to modify the permissions of files and directories.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/linux\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"chmod Command Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\",\"name\":\"Prepbytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"caption\":\"Prepbytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"chmod Command Linux","description":"The chmod command, which stands for \u201cchange mode,\u201d is a powerful tool that allows users to modify the permissions of files and directories.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/","og_locale":"en_US","og_type":"article","og_title":"chmod Command Linux","og_description":"The chmod command, which stands for \u201cchange mode,\u201d is a powerful tool that allows users to modify the permissions of files and directories.","og_url":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2023-11-30T08:58:26+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg","type":"","width":"","height":""}],"author":"Prepbytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prepbytes","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/"},"author":{"name":"Prepbytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e"},"headline":"chmod Command Linux","datePublished":"2023-11-30T08:58:26+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/"},"wordCount":719,"commentCount":0,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg","articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/","url":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/","name":"chmod Command Linux","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg","datePublished":"2023-11-30T08:58:26+00:00","description":"The chmod command, which stands for \u201cchange mode,\u201d is a powerful tool that allows users to modify the permissions of files and directories.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/chmod-command-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1701334676449-chmod%20Command%20Linux%20.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/chmod-command-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"Linux","item":"https:\/\/prepbytes.com\/blog\/category\/linux\/"},{"@type":"ListItem","position":3,"name":"chmod Command Linux"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e","name":"Prepbytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","caption":"Prepbytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/18404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=18404"}],"version-history":[{"count":2,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/18404\/revisions"}],"predecessor-version":[{"id":18456,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/18404\/revisions\/18456"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=18404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=18404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=18404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}