{"id":825,"date":"2015-04-14T05:23:02","date_gmt":"2015-04-14T05:23:02","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=825"},"modified":"2015-04-14T17:26:11","modified_gmt":"2015-04-14T17:26:11","slug":"linux-basic-command-directory-access-rights","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/linux-basic-command-directory-access-rights\/","title":{"rendered":"Linux Basic Command &#8211; Directory Access Rights"},"content":{"rendered":"<p>In linux there the file access is based under three categories<\/p>\n<pre>\r\n CurrentUser - Users in Group - Other Users\r\n<\/pre>\n<pre>\r\n  drwxr-xr-x \r\n<\/pre>\n<p><em><br \/>\ndrwxr &#8211; CurrentUser can read, write and execute<br \/>\nxr    &#8211; Users in Group  can read and execute<br \/>\nx     &#8211; Users can execute<br \/>\n<\/em><\/p>\n<pre>\r\n >>ls -l\r\n-rw-r--r-- 1 root root    0 Apr 14 17:19 test.txt \r\n<\/pre>\n<p>The test.txt file has only Read and Write access (rw) for Current User &#8211; Read access for Users in Group &#8211; Read access for other Users<\/p>\n<pre>\r\n >>chmod u+x test.txt\r\n<\/pre>\n<p>Now the  test.txt file has Execute access along with Read and Write as below<\/p>\n<pre>\r\n >>ls -l\r\n-rwxr--r-- 1 root root    0 Apr 14 17:19 test.txt\r\n<\/pre>\n<p><strong>Giving Read wrtite to Group<\/strong><\/p>\n<pre>\r\n >>chmod g+r test.txt\r\n<\/pre>\n<p><strong>Giving read right to Current User, Group Users and Other Users<\/strong><\/p>\n<pre>\r\n >>chmod a+r test.txt\r\n<\/pre>\n<p><strong>Giving Execute right to Other Users<\/strong><\/p>\n<pre>\r\n >>chmod o+x test.txt\r\n<\/pre>\n<p><strong>rwx<\/strong> &#8211; 111  7<br \/>\n<strong>r-x<\/strong> &#8211; 101  5<br \/>\n<strong>rw-<\/strong> &#8211; 110  6<br \/>\n<strong>rw-<\/strong> &#8211; 101  4<br \/>\n<strong>-wx<\/strong> &#8211; 011  3<br \/>\n<strong>-w-<\/strong> &#8211; 010  2<br \/>\n<strong>&#8211;x<\/strong> &#8211; 001  1<br \/>\n<strong>&#8212;<\/strong> &#8211; 000  0<\/p>\n<p><strong>Example of binary format<\/strong><\/p>\n<pre>\r\n >>chmod 752  test.txt\r\n<\/pre>\n<p>Current User can rwx<br \/>\nGroup User can r-x<br \/>\nOther User can -w-<\/p>\n<p><strong>Giving Multiple Permission for Multiple User Types at Once<\/strong><\/p>\n<pre>\r\n >>chmod u+r, o+x test.txt\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In linux there the file access is based under three categories CurrentUser &#8211; Users in Group &#8211; Other Users drwxr-xr-x drwxr &#8211; CurrentUser can read, write and execute xr &#8211; Users in Group can read and execute x &#8211; Users can execute >>ls -l -rw-r&#8211;r&#8211; 1 root root 0 Apr 14 17:19 test.txt The test.txt&hellip; <a href=\"https:\/\/codethataint.com\/blog\/linux-basic-command-directory-access-rights\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[148],"tags":[],"class_list":["post-825","post","type-post","status-publish","format-standard","hentry","category-commands"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=825"}],"version-history":[{"count":9,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/825\/revisions"}],"predecessor-version":[{"id":834,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/825\/revisions\/834"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}